A variable is an important concept in Java language. It basically causes a compiler to set aside some memory at the time of compilation. It has part syntax rule and part declaration.
Java programming language defines the following kinds of variables. Which are as follows:
- Instance Variable: These variables have a unique value at each instance of a class.
- Class Variable: It is a field that has static modifier.
- Local Variable: The syntax used for declaration of local variable makes it inaccessible from the rest of the class.
- Parameters: Parameters are defined as Variables and not fields. It applied to almost all the appeals.