Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Programmer Certification (OCPJP)
GC doubt
ramya ray
Ranch Hand
Posts: 101
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, please guide what can be correct option..
class A{
public static void main(
String
args[]){
Object o = new Object(); //line 1
method(o); //not defined
o = null; // line 2
}
}
when will the object created at line 1 will be eligible for GC.
1. at line 2
2. it is not known to be sure.
I think it will be option 2.
Please help
Thanks !
Deepak Bala
Bartender
Posts: 6663
5
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
"method" might save a reference to "o" so you can never be sure
SCJP 6 articles
-
SCJP 5/6 mock exams
-
More SCJP Mocks
You can thank my dental hygienist for my untimely aliveness. So tiny:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
GC help needed
Question on GC
when is eligible for garbage collection?
More...