6.1.2 interface is not a class, cannot instantiate an interface, but can declare the variable of the interface; comparable x; The interface variable must refer to the class object that implements the interface; x = new Employee ();
Checks whether an object belongs to a particular class (instanceof);
Checks whether an object belongs to a particular interface (instance), if (AnObject instanceof comparable) {...}
6.1.3 Interfaces and abstract classes
An abstract class can only extend one class (single inheritance);
6.1.4 static method
A way to construct a file or directory by a sequence of strings, such as Paths.get ("jdk1.8.0", "JRE", "bin")
public interface Path
{
public static Path Get (String first...more)
{
Return Filesystems.getdefault (). GetPath (First, more);
}
...
}
6.1.5 Default method
You can provide a default implementation for an interface method.
public interface comparable<t>{
Default int Comparableto (T other) {return o;}
}
6.1.6 Resolving default method conflicts
If you first define a method as the default method in one interface, and then define the same method in the superclass or another interface?
1) Super class priority. If the superclass provides a specific method, the default method with the same name and with the same parameter type is ignored.
2) interface conflicts. If a hyper-interface provides a default method, and the other interface provides a method with the same name and the same parameter type, this method must be overridden to resolve the conflict.
Java Core Technology Volume One note 6.1. Interface lambda expression inner class