Garbage Collector
Garbage Collector
1. By nullifying reference.
2. Reassigning reference.
3. Iland Isolation Reference.
Class Test ()
{
Public static void main(String arg[])
String s1 = new string();
s1 = null;
System.gc();
}
}
public void finalize() throws
throwable{
System.out.println(“Finalize”);
}
}
gc()
Example:-
Simple Example of Garbage Collection
in Java.
Loggers – (log4j)
Log 4j is the framework
Facebook.com (web
application)
Amazon.com
Flipkart.com.