单选题public class X {   public object m () {   object o = new float (3.14F);   object oa = new object [1];   oa[0]= o;   o = null;   oa[0] = null;   return o;   }   }   When is the float object created in line 3, eligible for garbage collection?()A Just after line 5.B Just after line 6.C Just after line 7.D Just after line 8(that is, as the method returns).

单选题
public class X {   public object m () {   object o = new float (3.14F);   object oa = new object [1];   oa[0]= o;   o = null;   oa[0] = null;   return o;   }   }   When is the float object created in line 3, eligible for garbage collection?()
A

 Just after line 5.

B

 Just after line 6.

C

 Just after line 7.

D

 Just after line 8(that is, as the method returns).


参考解析

解析: 暂无解析

相关考题:

单选题Which method in the Thread class is used to create and launch a new thread of execution?()Aensp;Run();Bensp;Start();Censp;Execute();Densp;Run(Runnableensp;r);Eensp;Start(Runnableensp;r);Fensp;Execute(Threadensp;t);

单选题int x= 10;  do {  x--;  } while(x 10);  How many times will line 37 be executed?()A ten timesB zero timesC one to me timesD more than ten times

单选题public class X {   public static void main (String args) {   byte b = 127;   byte c = 126;   byte d = b + c;   }   }   Which statement is true?()A Compilation succeeds and d takes the value 253.B Line 5 contains an error that prevents compilation.C Line 5 throws an exception indicating “Out of range”D Line 3 and 4 contain error that prevent compilation.E The compilation succeeds and d takes the value of 1.

单选题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;

单选题import java.util.*;  class KeyMaster {  public int i;  public KeyMaster(int i) { this.i = i; }  public boolean equals(Object o) { return i == ((KeyMaster)o).i; }  public int hashCode() { return i; }  }  public class MapIt {  public static void main(String[] args) {  Set set = new HashSet();  KeyMaster k1 = new KeyMaster(1);  KeyMaster k2 = new KeyMaster(2);  set.add(k1); set.add(k1);  set.add(k2); set.add(k2);  System.out.print(set.size() + “:”);  k2.i = 1;  System.out.print(set.size() + “:”);  set.remove(k1);  System.out.print(set.size() + “:”);  set.remove(k2);  System.out.print(set.size()); }  }  What is the result?()A 4:4:2:2B 4:4:3:2C 2:2:1:0D 2:2:0:0E 2:1:0:0F 2:2:1:1G 4:3:2:1

单选题You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?()A PublicB PrivateC ProtectedD TransientE No access modifier is required.

单选题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();

单选题Under which circumstances will a thread stop?()AThe method waitforId() in class MediaTracker is called.BThe run() method that the thread is executing ends.CThe call to the start() method of the Thread object returns.DThe suspend() method is called on the Thread object.EThe wait() method is called on the Thread object.

多选题public class Foo {   private int val;   public foo(int v) (val = v;) }   public static void main (String args) {   Foo a = new Foo (10);   Foo b = new Foo (10);   Foo c = a;   int d = 10;   double e = 10.0;   }   Which three logical expression evaluate to true? ()A(a ==c)B(d ==e)C(b ==d)D(a ==b)E(b ==c)F(d ==10.0)