I. Abstract class
1. Abstract classes are not understood, abstract
2. Characteristics of abstract Fatigue:
1). Abstract class and abstract methods must be decorated using the abstract keyword
2). Abstract classes do not necessarily have abstract methods, classes with abstract methods must be abstract classes or interfaces
3). Abstract classes can not be instantiated, in a polymorphic way, there is a specific subclass instantiation, in fact, this is a polymorphic, abstract polymorphism
4). Subclasses of abstract classes are either abstract classes or override all abstract methods
3. Member characteristics of abstract classes
1) member variable: can be either a variable or a constant, abstract is not allowed to modify the member variable
2). There is a constructor method for subclasses to access the initialization of the parent class
3). Member method: can be either non-abstract or non-abstract
Two. Interface
1. Interface: From the narrow sense refers to the Java interface, from a broad sense of the external provision of rules is the interface
2. Features of the interface:
A. The interface is represented by the keyword interface;
B. Class implementation interfaces are represented by implement;
C. Interfaces cannot be instantiated
D. The subclass of an interface can be an abstract class, or a concrete class, to override all abstract methods in an interface
3. Features of the interface members:
1). Member variable: can only be constant, and is static and public
2). No construction method in the interface
3). Member methods can only be abstract methods
4). Classes and interfaces are implementation relationships, interfaces and interfaces are inheritance relationships
Abstract classes and Interfaces