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.

相关推荐
偏爱自由 !1 小时前
2:IDEA中git的使用--基础操作
java·git·intellij-idea
LiaoWL1231 小时前
【SpringBoot合集-03】Spring Boot 启动过程学习
java·spring boot·学习
Huangjin007_1 小时前
【C++11篇(二)】右值引用、移动语义保姆级讲解!
开发语言·c++
孟浩浩3 小时前
JAVA SpringAI+阿里云百炼应用开发
java·开发语言·阿里云
钱多多_qdd3 小时前
ListUtil#split和remove搭配使用的坑
java
碧蓝的水壶3 小时前
数据转换过程
java·开发语言·windows
2501_947575809 小时前
计算机毕业设计之jsp开山车行二手车交易系统
java·开发语言·hadoop·python·信息可视化·django·课程设计
骑士雄师9 小时前
java面试题 4:鉴权
java·开发语言
时间的拾荒人11 小时前
C语言字符函数与字符串函数完全指南
c语言·开发语言