That is, there is no specific instance object class. Abstract classes are similar to "templates" to create and modify new classes based on their formats. Objects cannot be directly created by abstract classes. They can only be derived from abstract classes to create objects. When a class is declared as an abstract class, a modifier must be added before the class.
The member methods in the abstract class can include general methods and abstract methods. When a method is an abstract method, it means this method. Otherwise, the method of its subclass is still
Abstract classes do not have actual functions and can only be used to derive their subclasses. Abstract classes can contain constructor methods, but they cannot be declared as abstract.
Call methods in abstract classes
Summary: classes and methods.
Abstract Class AA System. out. println ("can" AbstractClass System. out. println ("override abstract method" System. out. println ("I am the AA method of the aa interface "}
Interface
The interface is also a type of abstract class, and the slot we see is based on
The interface only defines the specifications that the class should follow, but does not care about the internal implementation of the class. The interface only specifies the methods required for this class, thus implementing it.
Interface features:
A a =. a (); Integer number = 15; StringBuffer sb = StringBuffer ("ad"); a (); B (); C D System. out. println ("override Interface C abstract method" System. out. println ("override the abstract method of interface B" System. out. println ("overwriting the abstract method of interface "}
Summary
An abstract class can only use an inheritance relationship once. However, a class can implement multiple interfaces.
The abstract can have its own data members or non-abstract member methods.
.
Conclusion