Code example for PhantomReference

0
		Reference fromQue = referenceQueue.poll();
		System.out.println(fromQue);
		 
		ReferenceQueue rq= new ReferenceQueue(); 
		String s="hello";
		Reference r= new PhantomReference(s,rq); 
		System.out.println(rq.poll());
		s=null;
		System.gc();	
		System.out.println(rq.poll());
	} 
	 
	 
	@Override 
	protected void finalize() throws Throwable { 
		strongRef = this;
	} 
	 
	 
	@Override 
	public String toString() {