Alfred Raouf - Egypt - SCJP 1.4<br />Kemety.equals(Egyptian) // returns true
Whatever doesn't kill us ...<br />Is probably circling back for another try.<br />SCJP 1.4
Alfred Raouf - Egypt - SCJP 1.4<br />Kemety.equals(Egyptian) // returns true
Originally posted by Alfred Kemety:
So what's this thing about local variables beeing only eligible for GC after the method finish executing???
Whatever doesn't kill us ...<br />Is probably circling back for another try.<br />SCJP 1.4
So what's this thing about local variables beeing only eligible for GC after the method finish executing???
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Originally posted by Alfred Kemety:
So what's this thing about local variables beeing only eligible for GC after the method finish executing???
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Originally posted by Barry Gaunt:
An object such as that formed by new String("a string literal"); is NOT a string literal.
-Barry
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Originally posted by Barry Gaunt:
Dan, that last addition of yours was what I was trying to imply, it's just I was to lazy to write it down
BUT I would like to argue with your use of the term "local variable". To me a local variable is one that exists only on the stack, the object that a local reference variable references exists in/on the heap. That's where garbage collection happens. The local reference variable (if set to null) is still on the stack until it goes out of scope; it's just not referencing anything, and is never garbage collected.
-Barry
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Whatever doesn't kill us ...<br />Is probably circling back for another try.<br />SCJP 1.4
Originally posted by William Brogden:
I had a mock exam test question that relied on the local variable not being GCed until the method exited. This turned out to be true in early versions of the JDK but incorrect in later versions.
Co-Author of Head First Design Patterns
Just a Jini girl living in a J2EE world.
Consider Paul's rocket mass heater. |