This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes True/False: Unloaded instances Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "True/False: Unloaded instances" Watch "True/False: Unloaded instances" New topic
Author

True/False: Unloaded instances

Max Vandenburg
Ranch Hand

Joined: Mar 09, 2006
Posts: 51
Any class may be unloaded when none of it's instances and class objects that represent this class are reachable. (T/F?)


The answer is False.

my question is what does it mean by the term "unloaded", can anyone help clarify what it meant with the above statement.


MV
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
This seems to be referring to class loaders. Class loaders, as far as I know, are not a topic on SCJP.

Where did you find this question?.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Max Vandenburg
Ranch Hand

Joined: Mar 09, 2006
Posts: 51
Here was the explanation to the statement above:
A class or interface may be unloaded if and only if its class loader is unreachable (the definition of unreachable is given in JLS 12.6.1). Classes loaded by the bootstrap loader are not unloaded.
Sasikanth Malladi
Ranch Hand

Joined: Nov 04, 2000
Posts: 175
I agree. Classloaders are NOT a part of SCJP and this question is off-topic here.
The poster might want to refer elsewhere.
Sashi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: True/False: Unloaded instances
 
Similar Threads
Difference between Class Unloading and Object Finalization
What is memory leak in Java?
Garbage Collection
String pool question
class loading