❮ Previous Next ❯

Variables In Java

Java variable is nothing but a named memory allocation which may vary at the time of execution.A variable assigns a value.

For example, int x=20;
Here x is a variable and the value 20 is assigned to x which is also known as variable initialization.

Basically Java supports three types of variables, such as :

  1. Local variable
  2. Instance variable
  3. Static variable

Local Variable:

Instance Variable:

Static Variable:


class Demo
int x=30; //instance variable
static int y=200; //static variable
void get()
int z=50; //local variable
} //end of class
❮ Previous Next ❯

Follow Us


Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Email: info@silantechnology.com
      Phone: 0674-2361252
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved