Contact Us || Privacy Policy || About Us |
|
Static Keyword in Javastatic keyword is mainly used for memory management. We can be use with .
1) Static Variable in Java→ When a variable is declared as static, it is called static variable. → static variable refer to the common property of all objects. → static variable gets memory only once in the class area at the time of class loading. Example 1: Output ![]() Example 2: Change the course. Output ![]() 2) static method in Java
Example : Change the course. Output ![]() 3) Static block in Java
Example :Output ![]()
Next Topicthis keyword in java
|