Java Variable Types

A variable gives us named capacity that our code can control. Every variable in Java has a particular sort, which decides the size and format of the variable’s memory; the scope of values that can be put away inside that memory; and the set of operations that can be connected to the variable. You must make an explicit declaration of all variables before they can be utilized. Variables can be declared in the following manner:

Data type <variable name>;

Here data type is one of Java’s datatypes. On the other hand, a variable is the name or the identifier associated with the variable. To pronounce more than one variable of the pointed out type, you can utilize a comma-divided rundown. Here are a few examples of declarations:

The following declaration declares three integer variables.
int x, y, z;

In a similar manner, variables of other data types may also be declared.

Java supports three types of variables. These types are as follows:

  • Class/static variables
  • Instance variables
  • Local variables

 

For any query or issue, feel free to discuss on http://discuss.eduguru.in