Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET


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

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.

Your Valuable Comments Please...

Useful Computer Science EBooks