The static keyword is used in java for memory management. We may apply static keyword with variables, methods, blocks and nested class. The static keyword belongs to the class not to the instance of the class.
The static can be:
static variable : Is for the class i.e, belongs to class but does not belong to any object . The static variable gets memory only once in class area at the time of class loading.
static method : The static method can not use non static data member or call non-static method directly. This and super cannot be used in static context.
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!