常規理解上
public class JavaMemory{
private final int dataSize = (int) (Runtime
public void f(){
{
byte[] data
}
byte[] data
}
public static void main(String[] args) {
JavaMemoryPuzzle jmp = new JavaMemoryPuzzle();
jmp
}
}
在這個例子中
如果我們實際執行這個例子
這個問題該如何修正呢
public class JavaMemory{
private final int dataSize = (int) (Runtime
public void f(){
{
byte[] data
data
}
byte[] data
}
public static void main(String[] args) {
JavaMemoryPuzzle jmp = new JavaMemoryPuzzle();
jmp
}
}
發現這個問題
public class JavaMemory{
private final int dataSize = (int) (Runtime
public void f(){
{
byte[] data
}
int i=
byte[] data
}
public static void main(String[] args) {
JavaMemoryPuzzle jmp = new JavaMemoryPuzzle();
jmp
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/27088.html