interface IEat{
// public abstract void eat();
void eat(); //同上,因为在接口中只能定义抽象方法,系统默认这样就是同上的
// public static final int NUM_U=100;
int NUM_U=199; //同上,因为在接口中只能定义常量,系统默认这样就是同上的
}
1.定义接口,使用interface关键字interface IEat{}2.在一个接口中,只能定义常量、抽象方法,jdk1.8后可定义默认的实现方法在接口中定义的方法没有声明 访问修饰符默认为publicinterface IEat{ // public abstract void eat(); void eat(); //同上,因为在接口中只能定义抽象方法,系统默认这样就是同上的 // public static final int N