在尝试监控对象大小时,字符串对象不会显示在分析结果中。谁能告诉我 wat 是使它们显示在结果中的程序....
public class calling extends called {
called myobj3 = new called();
called myobj4 = new called();
public void function() {
myobj3.d="Plz";
myobj3.e="Help";
myobj4.d="Thank";
myobj4.e="You";
myobj3.act();
myobj4.act();
}
public static void main(String [] args) {
System.out.println("calls an object from called.java");
calling obj = new calling();
obj.function();
}
}
class called {
public String d;
public String e;
public void act() {
System.out.println(d+e);
}
}
memory profile 保留大小 Shallow Size [Unreachable] 称为 40 40 [Unreachable] 称为 40 40