by qompiler · 13y ago · 0 comments
http://docs.oracle.com/javase/tutorial/uiswing/components/pa...
This will leave the "hello" in ram (subject to GC):
String x = "hello"
x = null;
This will clear the "hello" from ram: char[] x = new char[]{'h','e','l','l','o'};
x[0] = '0'; x[1] = '0'; ...
This will leave the "hello" in ram (subject to GC): char[] x = new char[]{'h','e','l','l','o'};
x = null;