1. The methods in the interface are abstract methods. In general, abstract classes are not necessarily abstract methods. Abstract methods must be in an abstract class, as well as non-abstract methods. Inheriting the subclass of the abstract parent class, if there is still an abstract method, then this subclass is also an abstract class. That is, as long as there are abstract methods in the class, the class must be an abstract class, but abstract classes are not necessarily abstract methods.
2. Inheritance of interfaces:
Because the methods in the interface are abstract class methods. Subclasses want to be able to instantiate a method that must all rewrite the interface, so you must use a more, different
3. The difference between a method in an interface and a method definition inside an abstract class
abstract void Show () in the inner method of the abstraction class; is the default and method in the interface: public static final int num = 3;public static void show ();
4. A class that implements an interface cannot be instantiated as long as there is an abstract method.
5. If the member does not write a fixed modifier, it is added by default.
6.
7.
8. The benefits of multiple inheritance (can recognize multiple fathers at the same time, the benefits are many, you can get multiple methods at the same time) (disadvantage: There is the same method, will increase the uncertainty of the call)
9. The benefits of interfaces ( interfaces can be implemented in multiple implementations, which is the result of a multi-inheritance mechanism being improved in Java. A class can implement multiple interfaces )
10. The uncertainty of multiple inheritance is due to the fact that the methods of the parent class are subject. But interface implementations do not have this problem, because the body of the method is defined in the class that implements the interface
11. If the method of the abstract class is non-void
This is called the function of the Declaration, with the method body called function content or function implementation. As to how the method is implemented, it is the realization of the class.
Myth: The function in the interface must be explicit type, parameter.
12. Myth: (This will cause the call of uncertainty, is wrong)
Java Interface (top)