1.27.4.To remove a reference to an object is to set the reference variable to null.
public class MainClass { public static void main(String [] args) {
StringBuffer sb = new StringBuffer("hello");
System.out.println(sb);
sb = null;
// Now the StringBuffer object is eligible for collection
}
}