请说出E类中System.out.println的输出结果(答案中不要存在多余的空格)。class A {double f (double x, double y) { return x+y; }}class B extends A {double f (int x, int y){ return x*y; }}public class E{public static void main (String args [] ){B b=new B();System.out.println (b.f (3,5) );// 输出结果填第1空System.out.println (b.f (3.0, 5.0)); // 输出结果填第2空}}
请说出E类中System.out.println的输出结果(答案中不要存在多余的空格)。class A {double f(double x,double y){ return x+y; }static int g(int n) { return n*n; }}class B extends A {double f(double x, double y) {double m=super.f(x, y) ;return m+x*y;}static int g(int n){int m=A.g(n) ;return m+n;}}public class E {public static void main (String args [] ) {B b=new B () ;System.out.println(b.f(10.0,8.0)) ; //输出结果填第一空System.out.println(b.g(3)); //输出结果填第二空}}
若子类构造方法中无调用父类构造方法的语句,则在实例化子类对象时,会自动调用父类的无参构造方法
A. 对
B. 错