1, the abstract class can have a construction method, mainly when the subclass is instantiated, initialization. 2, there can be no abstract method in an abstract classThe point is not to let outsiders create objects.
3, the coexistence of abstract classes and keywords
Private Abstratc method (); To rewrite, but does not support overriding final abstract method (); Final is to let subclasses do not rewrite static abstract method (); Method belongs to a class and must be implemented 1, the abstract class can implement the interface in which the methods can be implemented, or can not be implemented. 2. Member Characteristics member variables (there are few interface variables in the interface) are
Public static Final
member Methods
all for public abstract
There are construction methods
method Body is
throw new Error ("Unresolved compilation problems: \n\tinterfaces cannot has constructors\n\tsyntax error on t Oken \ "}\", delete
Abstract class is the Is-a relationship interface is the like-a relationship after the class inheritance structure is an abstract class implementation of multiple interfaces, and then multiple subclasses to inherit the abstract class. Two interfaces have the same method of the same signature, when the specific subclass in the implementation of both methods, can only use one to replace. If the methods in the two interface represent different behaviors, you should make a difference on the method name if you are representing the same behavior, then you should proceed to extract it upward.
Dark Horse programmer-java Basics-Abstract classes and interfaces