Java - Memory Management Basics
Consider the following Java code snippet:
What is the expected output when this code runs?
public class TestGC {
public static void main(String[] args) {
String s = new String("hello");
s = null;
System.gc();
System.out.println("Done");
}
}What is the expected output when this code runs?
