In the C programming language, static is used with global variables and functions to set their scope to the containing file. In local variables, static is used to store the variable in the statically allocated memory instead of the automatically allocated memory.
Similarly, it is asked, what is the meaning of static variable in Java?
A static variable is common to all the instances (or objects) of the class because it is a class level variable. Like variables we can have static block, static method and static class, to read about them refer: static keyword in java.
What is the use of a static variable?
static variables are used when only one copy of the variable is required. so if you declare variable inside the method there is no use of such variable it's become local to function only.. Variables declared static are commonly shared across all instances of a class.