当前位置:网站首页>创建对象时JVM内存结构
创建对象时JVM内存结构
2022-06-27 19:21:00 【zhengmayusi】
文章目录
代码
- Student类:
public class Student {
int no;
String name;
int age;
boolean sex;
String address;
}
- StudentTest类:
public class StudentTest {
public static void main(String[] args) {
Student s1 = new Student();
Student s2 = new Student();
}
}
JVM中对应内存结构图

note:
- s1、s2是局部变量(在方法中创建的变量),局部变量存储在栈内存中
- 对象和引用的区别?
- 对象是通过new出来的,在堆内存中存储
- 引用是:但凡是变量,并且该变量中保存了内存地址,指向了堆内存当中的对象(此例中main方法中的变量s1、s2就是保存了对象Student在堆内存中的地址)
边栏推荐
- 非常全面的DolphinScheduler(海豚调度)安装使用文档
- MySQL客户端工具推荐,一定想不到最好用巨然是它
- Sharing | intelligent environmental protection - ecological civilization informatization solution (PDF attached)
- White whoring red team goby & POC, how do you call white whoring?
- # Leetcode 821. Minimum distance of characters (simple)
- MySQL client tools are recommended. I can't imagine that it is best to use Juran
- College graduation thesis management system based on wechat applet graduation design
- Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)
- Show the comprehensive strength of strong products, and make the first show of 2022 Lincoln aviator in Southwest China
- Focus! Tips for installing fonts on domestic computers
猜你喜欢

A set of system to reduce 10 times the traffic pressure in crowded areas

Modify large online games through CE modifier

Codeforces Round #716 (Div. 2)

MYSQL 性能优化 index 函数,隐藏,前缀,hash 索引 使用方法(2)

富文本 考试 填空题

使用storcli工具配置RAID,收藏这一篇就够了

Save method of JPA stepping pit series

Focus! Tips for installing fonts on domestic computers

mysql使用笔记一

MySQL performance optimization index function, hidden, prefix, hash index usage (2)
随机推荐
CEPH distributed storage
Flutter隐藏AppBar的返回按钮
非常全面的DolphinScheduler(海豚调度)安装使用文档
开启生态新姿势 | 使用 WrodPress 远程附件存储到 COS
Show the comprehensive strength of strong products, and make the first show of 2022 Lincoln aviator in Southwest China
GoLand permanently activated
1029 Median
Codeforces Round #717 (Div. 2)
Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)
OpenSSL 编程 一:基本概念
Unity3d button adapts the size according to the text content
通过CE修改器修改大型网络游戏
SQL必需掌握的100个重要知识点:使用函数处理数据
Flood fighting and disaster relief, overcoming difficulties, and City United premium products rushed to the aid of Yingde to donate loving materials
MYSQL 性能优化 index 函数,隐藏,前缀,hash 索引 使用方法(2)
Codeforces Round #716 (Div. 2)
oss上传调用的是哪个方法
Oracle的CTAS能不能将约束等属性带到新表?
A set of system to reduce 10 times the traffic pressure in crowded areas
Squid proxy server