What is the difference between System.gc() and Runtime.gc()?
System.gc()
Runtime.gc()
In the runtime system the gc is instance method but in system method the gc is static .
because of this reason we prefer to use system.gc().