Java advocates interface-oriented programming rather than class-oriented programming, and personal understanding is about what to do and how to separate it for loose coupling purposes.
The basic data types are divided into four categories: integer, floating point, character type, Boolean type, and eight kinds.
There are three types of reference data: Class, interface, array;
1, the interface is not a class;
2, the interface also has properties and methods, the properties of the interface by default with public static final decoration;
3, the method in the interface by default with public abstract modification, the interface can not contain non-abstract methods;
4, a class can implement the interface, with the Implements keyword implementation, if a class implements an interface, then it must implement all the methods defined in the interface, unless the class is abstract;
5, a class can implement more than one interface, and a class can inherit only one class, Java is a single inheritance, but is multi-implementation;
6, a class must be first to write the inheritance, after writing the implementation;
7, the interface can inherit, between the interface can be multiple inheritance;
-The function of the interface is to compensate for the deficiency of single inheritance;
Thinking: What is the difference between an interface and an abstract class:
1, abstract class methods and properties do not have a default modifier,
The interface method is the abstract method by default;
2, abstract classes can have member methods can also have an abstract method,
There can be only abstract methods in the interface (it is said that the interface in JDK 1.8 can have a default implementation, no use);
3, abstract class can only be inherited, and to single inheritance,
Interfaces can be implemented by classes (multiple implementations) and can be inherited by interfaces (multiple inheritance);
Interfaces in Java (interface)