☞A named memory location, whose contains can be changed with in program execution is known as variable.
☞When you run any program, it consumes memory in RAM till its execution in process.
☞Examples : int counter; String name; int[] ages; char letters[];
☞String is a predefined class not a primitive data type.
Note : Predefined class name always have first letter in capital.☞Three types of variables in java : local variables, instance variables, and static variables.
☞A variable which is declared inside the method is called local variable.
☞A variable which is declared inside the class but outside the method is called instance variable.
☞It is not declared as static.
☞A variable that is declared as static is called static variable.
☞It cannot be local.
class TypesOfVariables{ int data=50; //instance variable static int m=100; //static variable void method(){ int n=90; //local variable } }