What is static?
static is a keyword in java used to define static variables, and static methods. Static variables and static methods are also called as class variables and class methods.
static keyword can also be used to define a static initialization block, which is used to initialize static variables of a class.
both are true
there is no static keyword in java
static is a keyword used to declare static variables, to define static methods, and can be used with static initialization blocks.
the keyword static means it is related to "class" and not related to "object".
So static variables and static methods are also called as class variables and class methods. They are also called as class members.
Note: non static variables and methods are called as instance members.
Back To Top