nemorathwald: (Default)
[personal profile] nemorathwald
Over the holidays I started reading the textbook and creating flashcards in Supermemo on my handheld. These are the ones that were discussed in the first class. Let me know if you know a better way to put the questions, assuming that's your kind of thing.

Start a multi-line comment with:
/**

Each line of a multi-line comment starts with:
*

End a multi-line comment with:
*/

boolean
defines a variable as true or false

char
defines a variable as a Unicode character

byte
defines a variable as an integer up to 1 byte

short
defines a variable as an integer up to 2 bytes

long
defines a variable as an integer up to 4 byte

long
defines a variable as an integer up to 8 byte

float
defines a variable as a floating point up to 4 bytes

double
defines a variable as a floating point up to 8 bytes

What characters are allowed in variable identifiers?
letters, digits, underscore

Are variable names case-sensitive?
Yes.

Can a variable identifier start with a number?
No.

What does every assignment statement end with?
;

Date: 2009-01-13 02:01 pm (UTC)
From: [identity profile] loop-bell.livejournal.com
Comment about your "comment" markers -- the compiler only requires /* before and */ after comments; the second star on the first line and the star on every line thereafter are just a convention some programmers like because it makes it easier to tell apart comment lines from code. There are, of course, those who dislike the extra characters. For example, I prefer the // style comments for 1 or 2 line comments, and I only use the leading * if it's actually a comment (as opposed to commented out code).

Oh, and the ; ends any kind of statement, not just assignments. Think of it like the end of the line in Python.

left out

Date: 2009-01-16 05:34 am (UTC)
From: (Anonymous)
comments related to Javadocs, not that I would expect this to be part of the class and it is also more relavent to methods.

also add int and it's byte size, which I blieve is the same as long... just another way to declare a long.

Page Summary

March 2025

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
3031     

Most Popular Tags