摘要:
class Father { int x = 1; static int y = 2; void eat() { System.out.println("开吃"); } static void speak() { System.out.println("小头爸爸"); }}class Son e... 阅读全文
摘要:
在java中的接口主要是使用来拓展定义类的功能,可以弥补java中单继承的缺点。接口的定义格式:interface接口名{属性抽象方法}注意:1.接口中的所有属性 默认的修饰符是 public static final。2.接口中的所有方法 默认的修饰符是 public abstract。接口的特点... 阅读全文