class variables, member variables, local variables
A class variable (also called a static variable) is a variable in a class that is independent of the method and is decorated with static. (Static represents "global", "static", used to decorate member variables and member methods, or static code blocks (static code blocks are independent of class members, the JVM executes static code blocks when loading classes, and each code block executes only once, sequentially)).
Member variables (also known as "instance variables", "fields") are variables that are independent of the method in the class, but do not have static adornments.
A local variable is a variable in the method of a class.
Look at the following pseudo code description:
public class variable{
static int allclicks=0;//class variable
String str= "Hello World";//instance variable
public void Method () {
int i =0;//local variable
}
}
A member variable is also called a field, an instance variable, and is called a property or field in an entity class or data class. When a member variable can be changed, it is called the state of the object.
Constants: With final adornments, values cannot be modified once given