ReferenceQueue rq=new ReferenceQueue(); SoftReference <class> ob=new SoftReference<class>(object_of_class,rq);
The API says that all weak and soft references are cleared as they are enqueued. So, for the above code, as soon as the JVM sees that "object_of_class" is softly reachable, it will enqueue it, and clear the soft reference. "clearing the soft reference" here means making ob=null or making ob.get() to return null? ob,get() will definitely return null after this, but what is "clearing the soft reference" ?