下列选项中,能实现对父类的getSalary方法重写的是______。 class Employee{ public Double getSalary(){}; }
A. class Manager extends Employee{ public int getSalary(Double x){};}
B. class Manager extends Employee{ public Double getSalary(int x,int y){};}
C. class Manager extends Employee{ public Double getSalaryO{};}
D. class Manager extends Employee{ public int getSalary(int x,int y){};}
下列程序的运行结果是______。 public class Shape {public Shape(){ System.out.println("shape"); } } public class Circle extends Shape { public Circle(){ System.out.println("Circle"); } public static void main(String args[]) {Shape d = new Circle() } }
A. Shape
B. Circle
C. ShapeCircle
D. 程序有错误
下列关于Object类中定义的方法的描述,正确的是______。
A. 其他类不能调用
B. 其他类部分能调用
C. 其他类大部分不能调用
D. 其他类全部能调用
阅读下面程序: public class ConcatTest { public static void main(String[] args) { Strinq str1="abc"; String str2="ABC"; String str3=str1.contat(str2); System.out.println(str3); } } 程序运行结果是______。
A. abc
B. ABC
C. abcABC
D. ABCabc