concept system.gc in category java

This is an excerpt from Manning's book Java SE 11 Programmer I Certification Guide.
Using System.gc() or Runtime.getRuntime().gc()
As a programmer, you can’t start execution of Java’s garbage collector. You can only request it to be started by calling System.gc() or Runtime.getRuntime().gc(). But calling this method doesn’t guarantee when the garbage collector would start (the call can even be ignored by the JVM). Watch out for exam questions that query you on the number of instances that have been garbage collected after calling System.gc(). It won’t guarantee any count, at any line of code.

This is an excerpt from Manning's book OCA Java SE 8 Programmer I Certification Guide.
Using System.gc() or Runtime.getRuntime().gc()
As a programmer, you can’t start execution of Java’s garbage collector. You can only request it to be started by calling System.gc() or Runtime.getRuntime().gc(). But calling this method doesn’t guarantee when the garbage collector would start (the call can even be ignored by the JVM). Watch out for exam questions that query you on the number of instances that have been garbage collected after calling System.gc(). It won’t guarantee any count, at any line of code.