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.

相关推荐
麦麦麦当劳大王3 小时前
【油猴脚本】Boss直聘 岗位职责复制
开发语言·前端·javascript
starzy19903 小时前
深入理解Scala Map:从实现原理到工程实践
开发语言·后端·scala
只睡四小时4 小时前
Three.js Sub-tick:漏判 60.7%→0
开发语言·javascript·性能优化·ecmascript·游戏开发·three.js·碰撞检测
码农小河664 小时前
基于SSM+JSP的高校专业信息管理系统【附源码+数据库】
java·开发语言·数据库
东鹏特饮6 小时前
系统运维(传统/通用运维)面试题
开发语言·php
风若飞7 小时前
Spring Ai 入门遇到问题1
java·后端·spring
今天要早睡_7 小时前
C++01_入门基础复习
开发语言·c++
Nuanyt7 小时前
LeetCode Hot 100 链表专题(五)· 2 题(Java)
java·算法·leetcode·链表
黑马程序员毕设8 小时前
基于 Java 的餐饮点餐系统设计与应用报告
java·开发语言
SL_staff8 小时前
从文档工具到知识中枢:基于JVS数字底座构建企业级统一内容管理平台的技术实践
java·开源·全栈