Saturday, September 5, 2009

SCJP Questions

Given:
1 public class X (
2 public object m () {
3 object o = new float (3.14F);
4 object [] oa = new object [1];
5 oa[0]= o;
6 o = null;
7 return oa[0];
8 }
9 }
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 (that is, as the method returns)
D. Never in this method.
Answer: D

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */