Witscale Test Center

8.3 Initialization of variables


8.3 Initialization of variables

There are typically two types of variables in any Java class, the member variables and the ocal variables. The member variables are defined inside the class body. The local variables are also declared inside the class body but also inside either a code block or a method body. Member variables are automatically initialized whereas the local variables need explicit initialization by the programmer.