JAVA

STATIC





JAVA MOD1       course cody

STATIC

Suryansh Nadda

nody



  

STATIC is a keyword in java. in simple words when we declare any variable,method static then only single memory space is allocated to memeory. it means every time you change the value of static variable the new value will be stored and old will be removed .



  

1)Defining static variable
2)using this



  

1)Static method declaration




  

1)STATIC BLOCK
Static block will be executed before execution of method.



  

Java static blocks will be called when JVM loads the class into memory, means it will be called only once. But constructor will be called everytime object is declared



  

STATIC CLASS








other avilable courses


codenody