Variables : Variables « Language « Java Tutorial

Variables are data placeholders. There are two data types in Java:

  1. Reference types provides a reference to an object.
  2. Primitive types hold a primitive.

1.9.2.Variable Dynamic Initialization
1.9.3.Demonstrate lifetime of a variable
1.9.4.shows the proper way to declare a class variable named helloMessage
1.9.5.You don't have to place class variable declarations at the beginning of a class.
1.9.6.helloMessage variable is declared as a local variable: