Java Programming Chapter 4——Class loading

Class loading

1. Concept: When the JVM uses a class for the first time, it finds the corresponding class file through the classPath, and obtains the relevant information of the class (package name, class name, parent class, properties, methods, etc.) from the class file, and the class stored in the JVM is loaded only once.

2 . Timing of class loading

(1) When an object of a class is created for the first time, the class is loaded first. Re-creating an object.

(2) Using static members (static attributes and static methods) in a class for the first time will lead to class loading.

(3) Subclass class loading will lead to class loading of its parent class: Creating a subclass object for the first time will use the static attributes and static methods of a subclass for the first time.

相关推荐
学长毕设18 分钟前
基于SpringBoot景区停车场预约管理系统-附源码
java·spring boot·后端
未秃头的程序猿19 分钟前
800 万条数据批量导出:我用线程池写出了 4 个 bug
java·后端
有个傻瓜20 分钟前
前端订单 ID 查不到详情:Java 雪花 Long 经 JSON 到小程序的精度丢失排查与四种方案实测
java·spring boot·微信小程序·jackson·踩坑复盘
AAA修煤气灶刘哥33 分钟前
旧系统要升级,为什么第一步是把旧结果存一份?
java·后端·架构
真上帝的左手37 分钟前
2. 编程语言-Java-Spring Boot-集成SkyWalking + Prometheus 性能工程闭环实战
java·spring boot·性能优化·架构·系统架构·prometheus·skywalking
码途行者1 小时前
每天10分钟学Go:第21课 错误
开发语言·后端·golang
挖掘狂人1 小时前
如何设计一套秒杀系统?
java·后端·小程序·云开发
codigger1 小时前
如何设计一套秒杀系统?
java·程序员·编程
Rain的Java大神之路1 小时前
Transformer 面试与 Java 落地:吃透 Self-Attention,从 QKV 公式到 KV Cache
java·后端·ai编程
sharemylove2 小时前
Java 常用类 学习笔记
java·开发语言·经验分享·笔记·学习