(1) Use of the static field in Java:
What is static?
It is a Java modifier that defines static variables and static methods.
When do you use it?
Typically used in tool classes, the static method is modified and then used by other classes of methods.
The use method is directly through the class name. method is used, eliminating the hassle of new objects and then calling methods.
What to pay attention to?
It is important to note that variables and methods are defined as static and will be loaded first when the class is loaded.
The fields and methods referenced by the static method can only be static.
(2) Differences and linkages between interfaces and abstract classes
Important Concept!
Interface Definition action (what to do), abstract class definition root (what is it)
What is an interface?
The interface is actually not a class, because it cannot be instantiated.
An interface is an abstraction of a method, which is abstract by default.
The interface must be implemented before it can be used.
What is an abstract class?
Object-oriented domain everything is an object, but the new object requires that the properties of the object be OK so that the new object can be instantiated and used.
But sometimes some concepts are not specific, such as person, do not know what his specific appearance, so sometimes need to pull out of such classes.
Differences and linkages
A class can inherit multiple interfaces, but abstract classes do not, only one is implemented.
Care about the access rights of properties and methods with abstraction, care for Java's multi-inheritance interface.
Every day, a bit of Java face question (a)