`
liurongcheng11
  • 浏览: 2766 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
社区版块
存档分类
最新评论

compiled class structure

 
阅读更多

 

The overall structure of a compiled class is quite simple. Indeed, unlike natively

compiled applications, a compiled class retains the structural information

and almost all the symbols from the source code. In fact a compiled class

contains:

• A section describing the modifiers (such as public or private), the

name, the super class, the interfaces and the annotations of the class.

• One section per field declared in this class. Each section describes the

modifiers, the name, the type and the annotations of a field.

• One section per method and constructor declared in this class. Each section

describes the modifiers, the name, the return and parameter types,

and the annotations of a method. It also contains the compiled code of

the method, in the form of a sequence of Java bytecode instructions.

There are however some differences between source and compiled classes:

• A compiled class describes only one class, while a source file can contain

several classes. For instance a source file describing a class with one inner

class is compiled in two class files: one for the main class and one for the

inner class. However the main class file contains references to its inner

classes, and inner classes defined inside methods contain a reference to

their enclosing method.

 

• A compiled class does not contain comments, of course, but can contain

class, field, method and code attributes that can be used to associate

additional information to these elements. Since the introduction of annotations

in Java 5, which can be used for the same purpose, attributes

have become mostly useless.

• A compiled class does not contain a package and import section, so all

type names must be fully qualified.

Another very important structural difference is that a compiled class contains

a constant pool section. This pool is an array containing all the numeric, string

and type constants that appear in the class. These constants are defined only

once, in the constant pool section, and are referenced by their index in all other

sections of the class file. Hopefully ASM hides all the details related to the

constant pool, so you will not have to bother about it.

  • 大小: 65.5 KB
分享到:
评论

相关推荐

    X-CART GOLD v3.4.9

    6. Compiled templates (for cache and Smarty internal use): ./templates_c 7. Dump of MySQL database is in ./sql/*.sql file. 8. Website images are located in ./*images directory. 9. Shipping modules ...

    GWT in Action

    For those interested in diving deeper into GWT, this chapter explores the underlying mechanisms, including bootstrapping, compiled code structure, and output files produced by the compiler. ...

    Progress/OpenEdge语言手册

    ABL is both a compiled and an interpreted language that executes in a run-time engine. The documentation refers to this run-time engine as the ABL Virtual Machine (AVM). When the documentation refers ...

    BobBuilder_app

    Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this...

    CE中文版-启点CE过NP中文.exe

    Structure Dissect: Fixed the popupmenu "change type" so it now affects all selected entries instead of just the first PointerOrPointee window: Fix the debug pointer or pointee window button text when ...

    Problem Solving with C++ (7th edition)

    - **Compiling and Running the Program**: Detailed instructions on compiling the source code using the chosen compiler and running the compiled program. - **Understanding Errors and Warnings**: ...

    i-vector的工具箱

    The MCR is a standalone set of shared libraries that enables the execution of compiled Matlab applications or components on computers that do not have Matlab installed. The MCR installer can be ...

    C PROGRAMMING TUTORIAL

    To run the compiled program: ```bash ./hello ``` #### C Basic Syntax C has a specific syntax that must be followed to write valid programs. ##### Tokens in C Tokens are the smallest units of a C ...

    apktool documentation

    apks are nothing more than a zip file containing resources and compiled java. If you were to simply unzip an apk like so, you would be left with files such as classes.dex and resources.arsc. $ unzip...

    python3.6.5参考手册 chm

    PEP 487: Simpler customization of class creation PEP 487: Descriptor Protocol Enhancements PEP 519: Adding a file system path protocol PEP 495: Local Time Disambiguation PEP 529: Change Windows ...

    Senfore_DragDrop_v4.1

    [C++ Error] DragDropFile.hpp(178): E2450 Undefined structure '_FILEDESCRIPTORW' [C++ Error] DropSource.hpp(135): E2076 Overloadable operator expected I have not been able to reproduce these ...

    VB编程资源大全(英文源码 控件)

    <END><br>46,FldrView.zip The Folderview ActiveX Control mimics the behaviour of the Windows Explorer Treeview showing the tree structure of the files and folders and other items in the shell's ...

    [Lisp相关文档].Lisp.Quick.Reference

    - 例如:`(defclass person () ((name :accessor person-name)))` 定义了一个Person类。 #### 10.2 Generic Functions 泛型函数 - CLOS中的泛型函数可以根据不同的类实例调用不同的方法。 - 例如:`(defgeneric ...

    rfc全部文档离线下载rfc1-rfc8505

    immediate and easy use by a wide class of users. With this goal, it seems natural to provide the ability to use any remote HOST as if it had been dialed up from a TTY (teletype) terminal. ...

    php.ini-development

    ;;;;;;;;... 1.... 2.... 3.... 4.... 5.... 6.... The syntax of the file is extremely simple.... Section headers (e.g.... at runtime.... There is no name validation.... (e.g.... previously set variable or directive (e.g....

    EurekaLog_7.5.0.0_Enterprise

    32)..Changed: Descriptions of EurekaLog project options now list corresponding property names of TEurekaModuleOptions class. 33)..Changed: Default template of ...

Global site tag (gtag.js) - Google Analytics