Java System gc() MethodThe gc() method of System class runs the garbage collector. Through this method, JVM makes best effort to reuse the memory of discarded objects for quick reuse. SyntaxExample 1Test it NowOutput: before garbage collection = 100 after garbage collection = 0 Example 2Test it NowOutput: null
Next TopicJava System
|