系统相关
首页 > 系统相关> > 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;
}

标签:name,age,person2,Person,person1,内存,JVM,JavaseLearn19
来源: https://www.cnblogs.com/TSCCG/p/14964478.html