how many types of variables are there in java? write a simple program by using those variables?

three types of variables in java

1)instance variables 

2)class variables/static variables

3)loacl variables

 

class Variables

{

int a=20;//instance variable

static int b=10;//class varariables

public static void main(String[] args) 

{

int c=100;//local variables

Variables v=new Variables();

System.out.println("the value of a="+a);

System.out.println("the value of b="+b);

System.out.println("the value of c="+c);

}

}

 

    output

the value of a=20

the value of b=10

the value of c=100