Static variables are those variable which is created with the help of static keyword in a class and it is also called class variable. It creates a single copy in the RAM and each object can share it.
Static variable directly accesses by the help of class name without using any objects.
How to Use it
Syntax : ClassName. VariableName;
For Example
{
Test( )
{
System. out. println( “Test Class Call...”);
}
}
{
{
Test obj =new Test( );
System. out. println ( “Value of Static Variable : “+ Test. x);
}
}