Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

True/False: Unloaded instances

 
Max Vandenburg
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?.
 
Max Vandenburg
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree. Classloaders are NOT a part of SCJP and this question is off-topic here.
The poster might want to refer elsewhere.
Sashi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic