Popular Posts

Tuesday, July 19, 2011

Default Member variable values in java

There are several kinds of variables:
  • Member variables in a class—these are called fields.
  • Variables in a method or block of code—these are called local variables.
  • Variables in method declarations—these are called parameters.

Automatic Initialization :

  • Field variables (class members) are automatically initialized to default values
  • Local variables (method or constructor variables) are not automatically initialized
  • Arrays, whether field or local variables, are automatically initialized to the default values of their declared type

No comments:

Post a Comment