JavaseLearn19-JVM内存图

JavaseLearn19-JVM内存图

JavaseLearn19-JVM内存图

执行以下程序时JVM的内存图

/**
 * @Author: TSCCG
 * @Date: 2021/07/02 17:26
 */
public class JvmDemo01 {
    public static void main(String[] args) {
        Person person1 = new Person();
        Person person2 = new Person();
        System.out.println(person1.name + " " + person1.age);
        person2.name = "张三";
        person2.age = 20;
        System.out.println(person2.name + " " + person2.age);
        int num = 10;
    }
}
class Person {
    String name;
    int age;
}
上一篇:python开发基础(五)面向对象--类属性和实例属性


下一篇:封装,继承,多态综合应用