Site hosted by Angelfire.com: Build your free website today!
 

Variable Default value

One Java peculiarity is the default initial values of these three types of variables. Both class variables and instance variables default to certain values:

Table 5. Default values for Class and Instance Variables

byte, short, int, long0
float, double0.0
char'\u0000'
booleanfalse
non-primitive typesnull

Local variables do not have default values, and must be initialised.