abstract class features:
1. Abstract classes and abstract methods must all use the abstract adornment.
2. In an abstract class, there can be non-abstract methods, or even empty classes without any methods or variables.
An abstract method is not defined in an abstract class for the purpose of making the class impossible to create an object.
3. Abstract methods, there is no method body.
For an abstract method, the access limiter can be public, protected, and not writable.
4. Abstract class, you cannot use new to create an object.
5 abstract method of abstract class, if only partial abstract method quilt class overrides, then the subclass is still abstract class, if the abstract class of all abstract methods Quilt class overrides, then the subclass can be a normal class, of course, it can be an abstract class.
interface (interface):
An interface can be thought of as a special abstract class: The methods in this abstract class are abstract, and the abstract class can be described in the form of an interface.
In 1.interface, there are defined constants, abstract methods.
For constants, the modifier used by default is: public static final.
For abstract methods, the modifier used by default is: Public abstract.
Modifiers can only be given any combination, of course, it is not written, either way, the effect is the same.
2. Interfaces can be implemented in multiple classes.
3. Between the interface and the interface, it can only be extended by extends. Known as: An inheritance relationship between an interface and an interface.
Although it is inherited (using extends), it can be written multiple, which is similar to multiple inheritance. For example:
Inter1, Inter2 are interface, then there is interface Inter3 extends inter1,inter2{} is correct.
For normal classes, CLA1,CLA2 is class, but class Cla3 extends cla1,cla2{} is wrong.
Abstract and interface in Java