jvm-类加载(类生命周期)

本文详细介绍了Java虚拟机(JVM)的类加载过程,包括加载、链接(验证、准备、解析)、初始化、使用和卸载等阶段。重点阐述了加载时的多种方式以及链接阶段的验证、准备和解析步骤。此外,还解释了类型、间接引用和直接引用的概念,以及JVM生命周期结束的四种情况。
摘要由CSDN通过智能技术生成

在java代码中,“类型”的加载loading,链接linking,初始化过程都是在运行期间完成的

1,加载(loading)一般指:查找并将类的字节码文件通过类加载器加载到内存中,
    还有其他方式加载例如:从网络上加载class;从jar加载class;java源文件动态编译并加载
    
    The Java Virtual Machine dynamically loads, links and initializes classes and interfaces. 
    java虚拟机动态加载,链接,初始化类和接口类型,
    Loading is the process of finding the binary representation of a class or interface type with a particular name and creating a class or interface from that binary representation.
    加载是一个发现具有特定名字的类和接口类型的二进制表现和从二进制表示创建类和接口的过程,
    Linking is the process of taking a class or interface and combining it into the run-time state of the Java Virtual Machine so that it can be executed. 
    链接是一个获取类和接口并且把它结合到虚拟机运行时状态被执行的过程。
    Initialization of a class or interface consists of executing the class or interface initial

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值