Hi,
Golden rule regarding default values of fields is::
If no intialization is provided for an instance variable either in the declaration or in constructor or in instance initiatlizer block then it is automatically initialized with the default value of its type when the class is instantiated.
So in above program, the instance variable is initialized with default value = 0.(int default value)
I hope that explains.
Ashu
-
SCJP 1.4