A class property is a variable that is shared between objects of that class. In the design phase, you analyze which class properties do not change depending on the object, and set these properties to class properties. The corresponding method is set to the class method.
If the method is not related to the caller, such a method is often referred to as a class method, which simplifies the invocation of a method because it is not necessary to create an object to invoke the class method.
Static keyword
In the Java class, you can use the static Modifier property, method, code block, inner class
After being modified members have the following characteristics:
Loaded as the class loads
Precedence over the existence of objects
Decorated members, shared by all objects
When access permission is allowed, the object is not created and is called directly by the class
Class method
You can use the class name. Method Name () to access the static tag's class method
The static property of the class can only be accessed inside the static method, and the non-static property of the class cannot be accessed.
Static is the method of the class. So the static method cannot have this
Overloaded methods require both static or non-static
Java Personal Learning Notes: Class Properties, class methods