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.

相关推荐
知无不研22 分钟前
lambda表达式的使用(3)
开发语言·c++·lambda
数智化管理手记31 分钟前
海量数据如何沉淀有效数据资产?数据标准化治理方案如何搭建?
java·大数据·人工智能
cfm_29141 小时前
SpringAI + Ollama 本地大模型
java·开发语言·人工智能·语言模型
鲸采云SRM采购管理系统2 小时前
采购管理系统哪家好?2026最新测评对比
java·服务器·数据库
C++ 老炮儿的技术栈2 小时前
基于Qt实现轻量化本地音乐播放器
开发语言·c++·qt·c·播放器·音乐
qq_448011162 小时前
C语言中的柔性数组
c语言·开发语言·柔性数组
小白学大数据2 小时前
长周期爬虫的数据一致性:断点续爬 + 事务回滚保障采集质量
开发语言·爬虫·测试工具
0x533 小时前
Java网络编程(二)
java·服务器·网络
zlinear数据采集卡3 小时前
D223上位机C#开发实战:从帧解析到波形显示的完整实现
开发语言·arm开发·嵌入式硬件·fpga开发·开源·c#
Flittly3 小时前
【雕虫大技】Agent 动态 Skill 供应链安全加固(三):输出校验与治理闭环实战
java·spring boot·spring