Java static keyword:
It is mainly used for memory management.
Java static keyword can be applied:
variable
method
block
nested class
Java static variable:
static variables are common for all the objects.
Memory is created only one time and that is used by all the objects.
Advantages of a Java static variable:
It saves more memory
Java static method:
static methods belong to a class .
static methods can be accessed by class name instead of an object.
static methods can access the static…