In: Computer Science
What does the static keyword mean?
The static keyword in Java means that the variable or method
that is shared between all instances of that same class as it
belongs to the type, not the actual objects themselves. So if we
any one of the instance changes the static variable value that will
be reflected to all instances of the same class.
static key word can be applied to variable and method.
public static int value = 0;//appliying static on variable
public static void getValue() {//appliying static on method
}