What Is Variable In Java ?


3 Answers

Lily James Profile
Lily James answered

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.

Broad Kenny Profile
Broad Kenny , learningslot, answered

A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable.

Rajat Dhande Profile
Rajat Dhande answered

Declaration associates type to the variable whereas definition gives the value to the variable.

for more info on this visit

Answer Question