Types of variables Program

public class variable
{
       static int a=20;           /* Static variable */
       int b=30;                 /* Instance variable */
       public static void main(String args[])
    {
         int c=40;        /* Local variable */

        variable obj=new variable();  /*object creation */

      System.out.println(obj.b);
      System.out.println(a);
      System.out.println(c);
}
}

Comments

Post a Comment