当前位置:网站首页>JVM memory structure when creating objects
JVM memory structure when creating objects
2022-06-27 21:38:00 【zhengmayusi】
List of articles
Code
- Student class :
public class Student {
int no;
String name;
int age;
boolean sex;
String address;
}
- StudentTest class :
public class StudentTest {
public static void main(String[] args) {
Student s1 = new Student();
Student s2 = new Student();
}
}
JVM Corresponding memory structure diagram in

note:
- s1、s2 It's a local variable ( Variables created in methods ), Local variables are stored in stack memory
- The difference between objects and references ?
- The object is through new Coming out , Store... In heap memory
- The quotation is : But all variables , And the memory address is saved in this variable , Points to the object in the heap memory ( In this case main Variable in method s1、s2 Is to save the object Student Address in heap memory )
边栏推荐
- String类的常用方法
- AI painting minimalist tutorial
- 100 important knowledge points that SQL must master: creating calculation fields
- 快速excel导出
- 非常全面的DolphinScheduler(海豚调度)安装使用文档
- 关于异常处理的知识整理
- Tutorial | fNIRS data processing toolkit homer2 download and installation
- Go从入门到实战——行为的定义和实现(笔记)
- 跟我一起AQS SOS AQS
- Very comprehensive dolphin scheduler installation and use documents
猜你喜欢
随机推荐
华为伙伴暨开发者大会2022开源时刻全纪录
覆盖接入2w+交通监测设备,EMQ 为深圳市打造交通全要素数字化新引擎
Love math experiment | phase VI - Financial anti fraud case study
麒麟V10安装字体
Modify large online games through CE modifier
AI 绘画极简教程
Safe and efficient, non-contact "hand brushing" identification helps epidemic prevention and control
强制 20 天内开发 APP 后集体被裁,技术负责人怒批:祝“早日倒闭!”
于文文、胡夏等明星带你玩转派对 皮皮APP点燃你的夏日
让马化腾失望了!Web3.0,毫无希望
How to participate in openharmony code contribution
mysql使用笔记一
gomock mockgen : unknown embedded interface
抖音的兴趣电商已经碰到流量天花板?
100 important knowledge points that SQL must master: sorting and retrieving data
Golang 使用正则来匹配出子字符串函数
快递e栈——数组篇小型项目
送你12个常用函数公式,用过的都说好
Codeforces Round #717 (Div. 2)
Go from introduction to practice - Interface (notes)








