The static identifier is used for only one times initialization and the value access during the life time of the program /application. A separate memory is allocated for static variables. This value can be used between function calls. The default value of an uninitialized static variable is zero.
A static identifier of program execution depends on its default value of a uninitialized static
identifier which is zero.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
static identifier :
The static identifier is used for only one times initialization and the value access during the life time of the program /application. A separate memory is allocated for static variables. This value can be used between function calls. The default value of an uninitialized static variable is zero.
A static identifier of program execution depends on its default value of a uninitialized static identifier which is zero.
class StaticEx{static int initializeValue;
static{
initializeValue = 5;
System.out.println("I");
}
{
initializeValue = 50;
System.out.println("II");
}
StaticEx(){
initializeValue = 500;
System.out.println("II");
}
}