11.rbo = new ReallyBigObject(); 12.//more code here 13.rbo =

题目
单选题
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 objectrbo?()
A

System.gc();

B

Runtime.gc();

C

System.freeMemory();

D

Runtime.getRuntime().growHeap();

E

Runtime.getRuntime().freeMemory();

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

第1题:

Given:Which method will complete this class?()

A.public int compareTo(Object o){/*more code here*/}

B.public int compareTo(Score other){/*more code here*/}

C.public int compare(Score s1,Score s2){/*more code here*/}

D.public int compare(Object o1,Object o2){/*more code here*/}


参考答案:B

第2题:

11. List list = // more code here  12. Collections.sort(list, new MyComparator());  Which code will sort this list in the opposite order of the sort in line 12?() 

  • A、 Collections.reverseSort(list, new MyComparator());
  • B、 Collections.sort(list, new MyComparator()); list.reverse();
  • C、 Collections.sort(list, new InverseComparator( new MyComparator()));
  • D、 Collections.sort(list, Collections.reverseOrder( new MyComparator()));

正确答案:D

第3题:

11.rbo = new ReallyBigObject();12.//more code here13.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 objectrbo?()

A.System.gc();

B.Runtime.gc();

C.System.freeMemory();

D.Runtime.getRuntime().growHeap();

E.Runtime.getRuntime().freeMemory();


参考答案:A

第4题:

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

第5题:

现有:  1.  class Propeller2  {  2.   pulolic static void main (String[]args)//add code here?      3.    {  new Propeller2().topGo();  }      4.  5.void topGo()  //add code here?      6.    {   middleGo();  }      7.  8.void middleGo()  //add code here?  9. {   go();  System.out.println ("late middle");  }    void go()  //add code here?      12.    {throw new Exception();  }      13.  }  为使代码通过编译,需要在哪一行加入声明throws Exception?()     

  • A、只在第11行
  • B、在第8行和第11行
  • C、在第5行、第8行和第11行
  • D、在第2行、第5行、第8行和第11行

正确答案:D

第6题:

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

第7题:

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

第8题:

Given: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题:

public class Team extends java.util.LinkedList {  public void addPlayer(Player p) {  add(p);  }  public void compete(Team opponent) { /* more code here */ }  }  class Player { /* more code here */ }  Which two are true?()

  • A、 This code will compile.
  • B、 This code demonstrates proper design of an is-a relationship.
  • C、 This code demonstrates proper design of a has-a relationship.
  • D、 A Java programmer using the Team class could remove Player objects from a Team object.

正确答案:A,D

第10题:

10. class Line {  11. public class Point { public int x,y; }  12. public Point getPoint() { return new Point(); }  13. }  14. class Triangle {  15. public Triangle() {  16. // insert code here  17. }  18. }  Which code, inserted at line 16, correctly retrieves a local instance of a Point object?() 

  • A、 Point p = Line.getPoint();
  • B、 Line.Point p = Line.getPoint();
  • C、 Point p = (new Line()).getPoint();
  • D、 Line.Point p = (new Line()).getPoint();

正确答案:D

更多相关问题