What is true about the following code? (Choose all that apply)
public class Main { protected void finalize() { System.out.println("Roar!"); } public static void main(String[] args) { Main bear = new Main(); bear = null; System.gc(); } }
B, E.
Calling System.gc() suggests Java to run the garbage collector.
Java virtual machine can ignore the request.
finalize() runs if an object attempts to be garbage collected.