Website For Developers

Variables in Java




Local Variables in Java


Member Variables in Java


Static Variables in Java


Example of variables in Java

class Variables{

   void demo(){
     int a = 10; `//This is Local variable, its scope is within this function
   }
   int b = 25; //This is Member variable
   static int c = 50; //This is Static variable
}

Major Difference between normal data member and static data member