|
|
| garbage collector |
Expert:chandu
what is the use of garbage collector? |
| Answers |
Hi friend,
import java.util.Vector;
public class GarbageDemo{ public static void main(String[] args) { int size = 200; StringBuffer s; for (int i = 0; i < size; i++) { } System.out.println("Garbage Collection started explicitly."); long time = System.currentTimeMillis(); System.gc(); System.out.println("It took " + (System.currentTimeMillis()-time) + " ms"); } }
---------------------------------------------------------------
Read for more information.
http://www.roseindia.net/java/
Thanks.
Amardeep
|
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|