现有两个类AClass、BClass,以下描述中表示BClass继承自AClass的是( )。
A: class AClass extends BClass
B: class BClass implements AClass
C: class AClass implements BClass
D: class BClass extends AClass
A: class AClass extends BClass
B: class BClass implements AClass
C: class AClass implements BClass
D: class BClass extends AClass
举一反三
- 看下面一段程序: class Aclass{ void go(){ System.out.println("Aclass");} } public class Bclass extends Aclass{ void go{ System.out.println("Bclass"); } public static void main(String args[]){ Aclass a=new Aclass(); Aclass a1=new Bclass(); a.go(); a1.go(); } 以上程序运行结果是:(). A: Aclass <br/>Aclass B: Aclass <br/>Bclass C: Bclass <br/>Aclass D: Bclass <br/>Bclass
- 以下程序运行的结果是class Aclass{ public void go( ){ System.out.println("Aclass"); } } public class Bclass extends Aclass{ public void go( ){ System.out.println("Bclass"); } public static void main(String args[]){ Aclass a=new Bclass(); a.go(); } } A: Aclass B: Bclass C: Class Cast Exception D: 语法错误
- 阅读以下程序,写出结果。class AClass{ void go(){ System.out.println("AClass 的go方法"); }}class BClass extends AClass{ void go(){ System.out.println("BClass 的go方法"); }}public class TestBClass{ public static void main(String[] args){ AClass a =new AClass(); BClass b=new BClass(); a.go(); b.go(); }}程序的输出结果为:
- 看下面一段程序: class Aclass{ void go() { System.out.println("Aclass"); }}public class Bclass extends Aclass{ void go() { System.out.println("Bclass"); } public static void main(String args[]){ Aclass a=new Aclass(); Aclass a1=new Bclass(); a.go(); a1.go(); }}以上程序运行结果是:( ) A: AclassAclass B: BclassBclass C: AclassBclass D: BclassAclass
- 以下程序运行的结果是class Aclass{ public void go( ){ System.out.println("Aclass"); } } public class Bclass extends Aclass{ public void go( ){ System.out.println("Bclass"); } public static void main(String args[]){ Aclass a=new Bclass(); a.go(); } } A: Aclass B: Bclass C: Class Cast Exception D: 语法错误