This is the 30th day of my participation in the August Text Challenge.More challenges in August

 Access (class Access flag bit)

 

Introduction to the

Access_flags is a mask of flags used to indicate access attributes for a class or interface

 classification

 This (index of This class)

 Introduction to the

This_class must be a valid index value for an item in the constant pool table. The members of the constant pool at the index must be a CONSTANT_Class_info structure that represents the class or interface defined by the class file.

Super (Superclass index)

 Introduction to the

  • For a class, the value of super_class is either 0 or a valid index value for an item in the constant pool table. If its value is not 0, the member of the constant pool at the index must be a constant of type CONSTANT_Class_info, which represents the immediate superclass of the class defined by the class file.

  • If the super_class value of the class file is 0, the class file can only be used to represent the Object class, because it is the only class that does not have a superclass

  • For an interface, the super_class entry in its class file must be a valid index value for an entry in the constant pool table. The member of the constant pool at this index must be the CONSTANT_Class_info structure representing the Object class.

 Interface

 Introduction to the

  • Represents the immediate parent interface of a class or interface

  • The representation of the parent interface consists of the total number of interfaces and an array of interfaces

  • Each parent interface element is CONSTANT_Class_info****

  • The data structure

 

 Field

 Introduction to the

  • Represents fields defined in a class (both static and non-static)

  • The data structure

Field_info

  • The data structure

access_flags

  • Represents the access tag for a field

  • There are nine markers

name_index

  • Represents field name

descriptor_index

  • Represents the index of the field descriptor

attributes_count

  • Represents the total number of field attributes

attributes_info

  • Represents an array of field attribute elements

There are six categories suitable for field attributes

1, ConstantValue

  • Represents the initial value of a static variable (static final) and must be a value type and a String (String cannot be new)

2, Synthetic

  • Class members do not appear in the source file and are generated automatically by the compiler

3, Signature

  • Generic signature

4, Deprecated

  • Obsolete field

5, RuntimeVisibleAnnotations

  • Annotations used, and are visible at runtime (the JVM can read them reflectively)
  • The annotation definition is the annotation of retentionPolicy.runtime

6, RuntimelnvisibleAnnotations

  • Annotations used, and are not visible at runtime (the JVM cannot reflect reads)

  • Annotation definitions are annotations to retentionPolicy.class

Annotate the life cycle definition

  • Retentionpolicy. SOURCE – Information about this annotation type is recorded only in the SOURCE file and discarded by the compiler at compile time, not in the class bytecode file

  • Retentionpolicy.class (default) — The compiler records annotations in the CLASS bytecode file but does not load them into the JVM. Unable to reflect read.

  • Retentionpolicy.runtime — The compiler records annotations in a class bytecode file that is also loaded into the JVM at execution time and can be read reflectfully.