Question

Which of the following is the correct syntax for suggesting that the JVM performs garbage collection?

A System.free()
B System.setGarbageCollection()
C Syste.out.gc()
D System.gc()
Answer & Explanation
Option: [D]

System.gc() is a program that runs for garbage collection. But it not reliable.