网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

public class Employee{   private String name;   public Employee(String name){   this.name = name;  }   public String getName(){   return name;  }  }   public class Manager extends Employee{   public Manager(String name){   System.out.println(getName());  }  }   执行语句new Manager(“smith”)后程序的输出是哪项?() 

  • A、 smith
  • B、 null
  • C、 编译错误
  • D、 name

参考答案

更多 “ public class Employee{   private String name;   public Employee(String name){   this.name = name;  }   public String getName(){   return name;  }  }   public class Manager extends Employee{   public Manager(String name){   System.out.println(getName());  }  }   执行语句new Manager(“smith”)后程序的输出是哪项?() A、 smithB、 nullC、 编译错误D、 name” 相关考题
考题 int x=0;  int y 10;  do {  y--;  ++x;  } while (x  5);  System.out.print(x + “,“ + y);  What is the result?() A、 5,6B、 5,5C、 6,5D、 6,6

考题 For a given Servlet Response response, which retrieves an object for writing binary data? ()A、 response.get writer ()B、 response.get Output Stream ()C、 response.getOutput Writer()D、 response.get Writer ().get Output Stream ()E、 response.get Writer (Writer.OUTPUT_BINARY)

考题 ()意味着一个操作在不同的类中可以有不同的实现方式。A、多态性B、多继承C、类的组合D、类的复用

考题 现有2个文件:      package x;      public class X{  public static void doX()  {System.out.print("doX");}      }   和:  class Find{  public static void main(String  []  args)  {    //insert code here      }     }  哪两行分别插入到类Find的第3行将编译并产生输出“doX”?()A、doX();B、X.doX();C、x.X.doX();D、x.X myX=new x.X();myX.doX();

考题 String foo = “blue”;  Boolean[]bar = new Boolean [1];  if (bar[0])  {  foo = “green”;  }   What is the result? () A、 Foo has the value of “”B、 Foo has the value of null.C、 Foo has the value of “blue”D、 Foo has the value of “green”E、 An exception is thrown.F、 The code will not compile.

考题 public class Test {   public static void leftshift(int i, int j) {  i=j;   }   public static void main(String args) {   int i = 4, j = 2;   leftshift(i, j);   System.out.printIn(i);   }   }   What is the result? () A、 2B、 4C、 8D、 16E、 The code will not compile.

考题 A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add(0,object), but does NOT need to support quick random access. What supports these requirements?() A、 java.util.QueueB、 java.util.ArrayListC、 java.util.LinearListD、 java.util.LinkedList