( http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html )
byte
short
int
long
float
double
boolean
char
uninitialized field will be set to a default value by the compiler.
but, uninitialized local variable will not be set to a default value by the compiler.
accessing an uninitialized local variable will result in a compile-time error!
// The number 26, in decimal
int decVal = 26;
// The number 26, in hexadecimal
int hexVal = 0x1a;
// The number 26, in binary
int binVal = 0b11010;
null can be used as a value for any reference type.
class literal refers to the object that represents the type itself.
ex) String.class
댓글 없음:
댓글 쓰기