题目内容

此题存在语法错误。如果需要保持Test类代码不变,修改程序,使得程序输出为:callmecallyou应如何修改,请将修改后的代码写在答案框中。源代码如下:abstract class A {abstract void callme();void metoo() {System.out.println("metoo");}}class B extends A {void callme() {System.out.println("callme");}void callyou(){System.out.println("callyou");}}public class Test {public static void main(String[] args) {A a = new B();a.callme();a.callyou();}}

查看答案
更多问题

只能修改son类代码,其他代码保持不变,要求程序输出:202.110.33.0源代码为:public class Test {public static void main(String[] args) {DerivedClass d= new son();System.out.println(d.getIp());}}abstract class BaseClass{String hostName="WUIT";abstract String getName();abstract String getIp();//设计者认为应该存在该方法}abstract class DerivedClass extends BaseClass{String ip = "202.110.33.0";String getName() {return hostName;}}class son extends DerivedClass{}

Object类型是系统类型,是所有类型的基类。Son是Object类型的派生类(子类)。要求补全代码,main方法输出运行结果为:12345class Son {int s ;int getsonValue(){return s;}Son(int i){1;}}public class Test {public static void main(String[] args) {Object[] sons = new Son[5];for (int i =0;i<5;i++){sons[i] =new Son( 2);System.out.println((( 3)sons[i]).getsonValue());}}}

请根据图中信息,判断右侧男士的气质类型

Match the priming strategy to its effect on customers.Strategy: When ads use red, we…

A. remember the product better
B. feel like we need to buy more
C. think a product is healthy
D. feel good about a product
E. think the product must be good because a famous person likes it

答案查题题库