black

Java认证考试综合练习

登录

单项选择题

现有:     
class Cat  {     
Cat (int c)  {System.out.print {"cat"+c+" ");  }     
}     
class SubCat extends Cat  {     
SubCat (int c){super (5); System.out.print ("cable");}     
SubCat()  {  this (4);  }     
public static void main (String  []  args)  {     
SubCat s= new SubCat();     
}     
}    
结果为:()     

A. cat5
B. cable
C. cat5 cable
D. cable cat5

相关考题

单项选择题 现有:  class Dog{ }  class Harrier extends Dog  { }       class DogTest{   public  static void main (String  []  args) {      Dog dl=new Dog();      Harrier hl=new Harrier();      Dog d2=hl;   Harrier h2=  (Harrier) d2;      Harrier h3=d2;     }      }  下面哪一项是正确的?()

单项选择题 现有:   public class Pet()  public class Cat extends Pet{)      执行代码  Cat c- new Cat();      Pet p=  (Pet)c;  后下列哪项是正确的?()

单项选择题 为了使得System.out.println()输出对象引用的时候得到有意义的信,我们应该覆盖Objectt{-的哪个方法?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3