通过代码分析java内存模型,执行代码:
public class Person { String name; int age; public void show(){ System.out.println(name); } public static void main(String[] args) { Person p1=new Person(); p1.age=24; p1.name="张三"; p1.show(); Person p2=new Person(); p2.age=35; p2.name="李四"; p2.show(); } }
标签:p2,p1,java,name,show,模型,Person,内存 From: https://www.cnblogs.com/l1pe1/p/16770172.html