knowledge of java interfaces

1, the interface with the interface to declare

// definition of an animal interfaces 
    public  interface Animal {
          public  void EAT ();
          public  void Travel (); 
    }

2, the interface method is an abstract method, there is not an abstract method thereof, and interface methods for the default access modifier public abstract

3, JDK1.8, the methods of the interface may be modified static and default, but the method must have been modified method thereof

Guess you like

Origin www.cnblogs.com/wgblog-code/p/11082198.html