11. public interface Status {  12. /* insert code here */ in

题目
多选题
11. public interface Status {  12. /* insert code here */ int MY_VALUE = 10;  13. }  Which three are valid on line 12?()
A

final

B

static

C

native

D

public

E

private

F

abstract

G

protected

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

interface Altitude {  //insert code here   }   和4个声明:   int HIGH = 7;  public int HIGH = 7;    abstract int HIGH = 7;   interface int HIGH = 7;  分别插入到第2行,有多少行可以编译?()  

  • A、 0
  • B、 1
  • C、 2
  • D、 3
  • E、 4

正确答案:C

第2题:

11. public class Counter {  12. public static void main(String[] args) {  13. int numArgs = /* insert code here */;  14. }  15. }  and the command line: java Counter one fred 42 Which code, inserted at line 13, captures the number of arguments passed into the program?() 

  • A、 args.count
  • B、 args.length
  • C、 args.count()
  • D、 args.length()
  • E、 args.getLength()

正确答案:B

第3题:

11. public class Commander {  12. public static void main(String[] args) {  13. String myProp = /* insert code here */  14. System.out.println(myProp);  15. }  16. }  and the command line:  java -Dprop.custom=gobstopper Commander  Which two, placed on line 13, will produce the output gobstopper?()

  • A、 System.load(”prop.custom”);
  • B、 System.getenv(”prop.custom”);
  • C、 System.property(”prop.custom”);
  • D、 System.getProperty(”prop.custom”);
  • E、 System.getProperties().getProperty(”prop.custom”);

正确答案:D,E

第4题:

10. interface Foo {}  11. class Alpha implements Foo {}  12. class Beta extends Alpha {}  13. class Delta extends Beta {  14. public static void main( String[] args) {  15. Beta x = new Beta();  16. // insert code here  17. }  18. }  Which code, inserted at line 16, will cause a java.lang.ClassCastException?() 

  • A、 Alpha a = x;
  • B、 Foo f= (Delta)x;
  • C、 Foo f= (Alpha)x;
  • D、 Beta b = (Beta)(Alpha)x;

正确答案:B

第5题:

11. public interface Status {  12. /* insert code here */ int MY_VALUE = 10;  13. }  Which three are valid on line 12?()

  • A、 final
  • B、 static
  • C、 native
  • D、 public
  • E、 private
  • F、 abstract
  • G、 protected

正确答案:A,B,D

第6题:

10. class Line {  11. public static class Point { }  12. }  13.  14. class Triangle {  15. // insert code here  16. }  Which code, inserted at line 15, creates an instance of the Point class defined in Line?() 

  • A、 Point p = new Point();
  • B、 Line.Point p = new Line.Point();
  • C、 The Point class cannot be instatiated at line 15.
  • D、 Line 1 = new Line() ; 1.Point p = new 1.Point();

正确答案:B

第7题:

interface A { public int getValue() }  class B implements A {  public int getValue() { return 1; }  }  class C extends B {  // insert code here  }  Which three code fragments, inserted individually at line 15, make use of polymorphism?()

  • A、 public void add(C c) { c.getValue(); }
  • B、 public void add(B b) { b.getValue(); }
  • C、 public void add(A a) { a.getValue(); }
  • D、 public void add(A a, B b) { a.getValue(); }
  • E、 public void add(C c1, C c2) { c1.getValue(); }

正确答案:B,C,D

第8题:

class One {  void foo() {}  }  class Two extends One {   //insert method here  }  Which three methods, inserted individually at line 14, will correctly complete class Two?()

  • A、 int foo() { /* more code here */ }
  • B、 void foo() { /* more code here */ }
  • C、 public void foo() { /* more code here */ }
  • D、 private void foo() { /* more code here */ }
  • E、 protected void foo() { /* more code here */ }

正确答案:B,C,E

第9题:

11. double input = 314159.26;  12. NumberFormat nf= NumberFormat.getInstance(Locale.ITALIAN);  13. String b;  14. //insert code here  Which code, inserted at line 14, sets the value of b to 3 14.159,26?() 

  • A、 b = nf.parse( input);
  • B、 b = nf.format( input);
  • C、 b = nf.equals( input);
  • D、 b = nf.parseObject( input);

正确答案:B

第10题:

11. rbo = new ReallyBigObject();  12. // more code here  13. rbo = null;  14. /* insert code here */  Which statement should be placed at line 14 to suggest that the virtual machine expend effort toward recycling the memory used by the object rbo?() 

  • A、 System.gc();
  • B、 Runtime.gc();
  • C、 System.freeMemory();
  • D、 Runtime.getRuntime().growHeap();
  • E、 Runtime.getRuntime().freeMemory();

正确答案:A

更多相关问题