Which of the following is false? Group of answer choices Memory leaks using Java are rare because of automatic garbage collection. Method finalize does not take parameters and has return type void. Objects are marked for garbage collection by method finalize. The garbage collector reclaims unused memory.

Respuesta :

Answer:

The wrong option is: "Objects ........ finalize."

Invoking the garbage collector is not possible directly. You can suggest the JVM perform garbage collection through System. gc();

Explanation:

You can make sure that the object is marked for the garbage collection by ensuring that there is no reference pointing to that object. And finalize is not responsible for marking the object for garbage collection. There is no direct way to invoke this facility of the garbage collector. You can only put forward the suggestion for the JVM to do the garbage collection through the System.gc(); Rest of the options are correct.

ACCESS MORE