`

The Java® Language Specification

    博客分类:
  • JAVA
 
阅读更多
12.Execution:

The Java Virtual Machine starts execution by invoking the method main of some
specified class, passing it a single argument, which is an array of strings


1 Load the Class.

The loading process is implemented by the class ClassLoader and its subclasses.
Different subclasses of ClassLoader may implement different loading policies. In
particular, a class loader may cache binary representations of classes and interfaces,
prefetch them based on expected usage, or load a group of related classes together.


If an error occurs during class loading, then an instance of one of the following
subclasses of class LinkageError will be thrown at any point in the program that
(directly or indirectly) uses the type:
• ClassCircularityError: A class or interface could not be loaded because it
would be its own superclass or superinterface (§8.1.4, §9.1.3, §13.4.4).
• ClassFormatError: The binary data that purports to specify a requested
compiled class or interface is malformed.
• NoClassDefFoundError: No definition for a requested class or interface could
be found by the relevant class loader.
12.3 Linking of Classes and Interfaces EXECUTION
320
Because loading involves the allocation of new data structures, it may fail with an
OutOfMemoryError.
2.Link Test: Verify, Prepare, (Optionally) Resolve
Verification checks that the loaded representation of Test is well-formed, with a
proper symbol table.


Preparation involves allocation of static storage and any data structures that are
used internally by the implementation of the Java Virtual Machine, such as method
tables.http://en.wikipedia.org/wiki/Symbol_table

Preparation involves creating the static fields (class variables and constants) for a class or interface and initializing such fields to the default values

does not require the execution of any source code; explicit initializers for static fields are executed as part of initialization (§12.4), not preparation.



Resolution is the process of checking symbolic references with other
classes and interfaces, by loading the other classes and interfaces that are mentioned
and checking that the references are correct.

errors in Resolution step: IncompatibleClassChangeError,IllegalAccessError,InstantiationError,NoSuchFieldError,NoSuchMethodError, UnsatisfiedLinkError.


3. Initialization of Classes and Interfaces
Initialization consists of execution of any class variable initializers and static
initializers of the class

4.Creation of New Class Instances


分享到:
评论

相关推荐

    The Java® Language Specification Java SE 7 Edition chm 版本

    《Java®语言规范》是Java开发者的权威指南,它详细定义了Java编程语言的各个方面,为Java SE 7版提供了一套完整的规范。这个chm(Compiled HTML Help)版本使得开发者能够更便捷地查阅和理解Java语言的核心概念、...

    The Java® Language Specification Java SE 12 Edition

    《Java®语言规范Java SE 12版》是Java编程语言的官方文档,详细阐述了Java SE平台版本12的编程语言的语法、结构和含义。本规范不仅为Java开发者提供了参考,也为实现Java虚拟机和编写其他语言的编译器提供了重要的...

    The Java® Virtual Machine Specification Java SE 12 Edition.rar

    《Java® Virtual Machine Specification Java SE 12 Edition》是官方发布的关于JVM在Java SE 12版本中的详细规范,旨在定义JVM如何执行字节码、管理内存以及实现各种平台无关的特性。 1. **JVM概述**: - JVM是...

    The Java® Virtual Machine Specification Java SE 11 Edition.rar

    《Java® Virtual Machine Specification Java SE 11 Edition》是Java开发工具包(Java Development Kit,JDK)的重要组成部分,它详细定义了Java虚拟机(Java Virtual Machine,JVM)的行为和运行机制。JVM作为Java...

    The Java® Virtual Machine Specification Java SE 8 Edition.rar

    《Java® Virtual Machine Specification Java SE 8 Edition》是Java开发者和研究人员的重要参考资料,详细阐述了JVM在Java Standard Edition 8(Java SE 8)中的工作原理、结构和行为。 一、JVM概述 JVM是一个抽象...

    The Java® Virtual Machine Specification Java SE 9 Edition.rar

    《Java虚拟机规范 Java SE 9版》是Java开发者和研究者的重要参考资料,它详细阐述了Java应用程序如何在Java虚拟机(JVM)上运行。这份规范定义了JVM的内部工作原理,包括字节码执行、内存模型、类加载机制、垃圾收集...

    Java编程规范 The Java Language Specification Java SE 9

    《Java® Language Specification》是Java编程语言的标准文档之一,它为开发者提供了详细的规范指南,帮助理解和实现Java语言的各种特性。Java SE 9版本作为Java语言发展的一个重要里程碑,引入了许多新特性和改进,...

    java specification

    Java技术规范(TheJava®Language Specification)是Java编程语言的官方文档,它详细描述了Java语言的语法、语义、类型系统、结构等各个方面,确保Java程序的可移植性、安全性和一致性。Java SE 8版是该技术规范的第...

    The Java® Virtual Machine Specification Java SE 10 Edition.rar

    《Java® Virtual Machine Specification Java SE 10 Edition》是Java开发的重要参考资料,它详细阐述了Java虚拟机(JVM)在Java SE 10版本中的工作原理和规范。JVM作为Java程序运行的基础,它的设计与实现对于理解...

    The Java® Virtual Machine Specification Java SE 7 Edition.rar

    《Java® Virtual Machine Specification Java SE 7 Edition》是Java开发工具包(Java Development Kit, JDK)的重要组成部分,它详细定义了Java虚拟机(Java Virtual Machine, JVM)的行为和规范。这个文档是Java ...

    自学java看什么书-强力推荐15本必看书籍-华清远见.docx

    4. **《Java核心技术卷》(The Java® Language Specification)**:由Java的创造者编写,这本书是Java编程语言的官方技术指南。对于深入理解语言的语法和机制,没有比这更好的资源了。从基础语法到高级特性,它都能...

    Java Language Conversion Assistant

    2.0 Overview Java Language Conversion Assistant is a tool that automatically converts existing Java-language code into Visual C#® for developers who want to move existing applications to the .NET ...

    Ecma-262 edition 6(ECMAScript® 2015 Language Specification)

    Ecma-262是ECMAScript标准的官方编号,其中第6版(ECMAScript® 2015 Language Specification)也被称作ECMAScript 6(简称ES6),是在2015年6月发布的。这个版本是ECMAScript历史上一次较大的升级,引入了大量新...

    The Single UNIX® Specification, Version 4

    《单一UNIX规范,第四版》(The Single UNIX® Specification, Version 4,简称SUSv4)是UNIX操作系统的一个重要标准,由The Open Group维护。这个规范定义了符合UNIX商标的操作系统必须遵循的一系列接口和技术要求...

    The Single UNIX® Specification, Version 2

    《单一UNIX®规范,版本2》(The Single UNIX® Specification, Version 2,简称SUSv2)是UNIX操作系统标准的重要里程碑,它定义了符合UNIX系统必须遵循的一系列接口、命令行工具和系统调用。这个规范对于确保不同...

    The OpenGL® Shading Language

    《OpenGL® Shading Language》是OpenGL图形编程领域中极为重要的参考文献,主要涉及的是GPU上的着色语言,也就是我们常说的GLSL(OpenGL Shading Language)。GLSL是用于定义和控制OpenGL渲染管道中的各种着色器的...

    Java Native Interface Specification R1.1

    Java Native Interface(JNI)是Java开发中的一个重要概念,它允许Java代码与其他语言编写的代码进行交互,尤其是与C或C++编写的本地应用程序接口(API)进行交互。JNI在Java应用程序中扮演着桥梁的角色,使得Java...

    CompactPCI ® Express Specification Revision 2.0

    CompactPCI ® Express Specification Revision 2.0 英文原版官方规范 March 22, 2013 一级目录 1 Introduction 2 Mechanical Requirements 3 Electrical Requirements 4 Keying Requirements

    PCI Express® Base Specification Revision 4.0 Version 1.0

    ### 关于PCI Express® Base Specification Revision 4.0 Version 1.0的知识点解析 #### 一、PCI Express 4.0概述 PCI Express (PCIe) 是一种高速串行计算机扩展总线标准,用于固定功能接口(如图形卡、固态硬盘等...

    PCI Express® Base Specification Revision 4.0, Version 1.0

    This specification describes the PCI Express® architecture, interconnect attributes, fabric management, and the programming interface required to design and build systems and peripherals that are ...

Global site tag (gtag.js) - Google Analytics