11c 11.13
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了11c 11.13相关的知识,希望对你有一定的参考价值。
package ty; abstract class A { public abstract void fun(); };
package ty; class B extends A { public void fun() { System.out.println("what is your name?"); } };
package ty; public class AandB { public static void main(String[] args) { B b=new B(); b.fun(); } }
package sy; abstract class A { private String name; public A(String name) { this.name=name; } public String getName() { return this.name; } public abstract void fun(); };
package sy; class B extends A{ public B(String name) { super(name); } public void fun() { System.out.println(super.getName()); } };
package sy; public class Adm { public static void main(String args[]) { B b = new B("大黄"); b.fun(); } };
package sy; public abstract class C { private String name; public C(String name) { this.name=name; } public String getName() { return this.name; } public abstract void fun(); }
package sy; public class D extends C { public D(String name) { super(name); } public void fun() { System.out.println(super.getName()); } }
package sy; public class CandD { public static void main(String[] args) { B b =new B("八戒"); b.fun(); } }
以上是关于11c 11.13的主要内容,如果未能解决你的问题,请参考以下文章