第4章 java接口抽象类知识讲解.pptVIP

  • 1
  • 0
  • 约小于1千字
  • 约 21页
  • 2020-12-17 发布于浙江
  • 举报
第4章 java接口抽象类;4.1 接口;4.1 接 口 ;4.1.1 接口定义;4.1.1 接口定义;4.1.2 接口的实现 ;interface A{ int x = 1; void method1(); } interface B extends A{ int x = 2; void method2(); } public class Example implements B{ public void method1(){ System.out.println(x = + x); System.out.println(A.x = + A.x); System.out.println(B.x = + B.x); System.out.println(Example.x = + Example.x); } public void method2(){ } public static void main(String[] args){ Example d = new Example(); d.method1(); } } ;4.1.3 接口作为类型 ;4.1.4 接口不应改变 ;4.2 抽 象 类 ;4.2 抽 象 类;4.2 抽 象 类;;4.2.3 抽象类和接口的比较 ;4.3 包 ;;

文档评论(0)

1亿VIP精品文档

相关文档