Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
SCJP 1.4 (86%)<br />SCWCD 1.4 (86%)<br />----------<br />If You dont succeed at first time,call it Version 1.0 !!!
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Originally posted by Steve Morrow:
I say it's a terrible question because it depends on knowledge of implementation of the Integer.toString(int i) method. GC is about letting the VM manage memory, not about whether or not references are or are not internally maintained by some class.
Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Can you please explain how does it affects the number of objects created(or GC'ed)if we do consider Integer.toString(int i);
You're right; it's not possible. Well, it *is*, but it's not practical, and certainly not something worth testing. Similarly, you won't be asked those types of questions about GC in relation to factory-type methods like. There will be a clear, unambiguous answer to the question on the test, at least to those who have an understanding of basic concepts of GC in Java.As far as i think our code will still Provide GC with 11 objects to collect. and the question for GC will always be asked in context to the given code. Otherwise there are many method that create Objects at background and let them be GC'ed, so should we always count those objects as well, while answering the GC questoins.
I dont think it is possible.
I am sorry if I have asked something silly.
11 objects will be GC'ed
Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
When GC runs, does it collects all the objects eligible for collection, or just enough to free the memory.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |