在Word 2016中,撤销前一次操作的快捷键是()。
阅读程序,请说出E类中【代码1】,【代码2】的输出结果。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】}}
阅读程序,说出下列B类中【代码1】,【代码2】的输出结果。class A {public int getNumber(int a) {return a+1;}}class B extends A {public int getNumber (int a) {return a+100;}public static void main (String args[]) {A a =new A();System.out.println(a.getNumber(10)); //【代码1】a = new B();System.out.println(a.getNumber(10)); //【代码2】}}
阅读程序,请说出E类中【代码1】~【代码3】的输出结果。class A {int m;int getM() {return m;}int seeM() {return m;}}class B extends A {int m ;int getM() {return m+100;}}public class E {public static void main(String args[]) {B b =new B();b.m=20;System.out.println(b.getM()); //【代码1】A a = b;a.m = -100; // 上转型对象访问的是被隐藏的mSystem.out.println(a.getM()); //【代码2】上转型对象调用的一定是子类重写的getM()方法System.out.println(b.seeM()); //【代码3】子类继承的seeM()方法操作的m是被子类隐藏的m}}