posted 17 years ago
Classes are unloaded at the discretion of the JVM. But they have to at least meet the below restrictions
Instances-If any instance of the class are still in existence then they will not be unloaded.
java.lang.Class-If a class's java.lang.Class object is still being referenced from another object, then it will not be unloaded.
String s=new String(); this code basically creates an object of the type String and assigns it to the s reference variable. And it returns a null when you try to access it.