编译并运行以下程序,以下描述哪个选项是正确的()1.classX{2.protectedStringtoString(){3.returnsuper.toString();}4.}
A. 编译通过运行无异常
B. 编译通过但运行时出错
C. 行2出错,不能成功编译
D. 不能成功编译,行3出错
类Parent、Child定义如下:public class Parent{public float aFun(float a, float b) throws IOException {}}public class Child extends Parent{//第6行}将以下哪种方法插入行6是不合法的
A. float aFun(float a, float b){ }
B. public int aFun(int a, int b)throws Exception{ }
C. public float aFun(float p, float q){ }
D. public int aFun(int a, int b)throws IOException{ }