Below is the program:
package annotationtype;
public class Example {
public static void main(String[] args){
}
}
got compiled with below byte code.
Classfile /D:/git/Java_programming/JavaCode/bin/annotationtype/Example.class
......
Compiled from "Example.java"
public class annotationtype.Example
.......
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Class #2 // annotationtype/Example
#2 = Utf8 annotationtype/Example
#3 = Class #4 // java/lang/Object
......
#18 = Utf8 SourceFile
#19 = Utf8 Example.java
{
public annotationtype.Example();
........
public static void main(java.lang.String[]);
......
}
SourceFile: "Example.java"
Using eclipse editor, In main()
method, if I type,
Example.
, eclipse editor immediately provides class
member of type Class<annotationtype.Example>
My understanding is,
below byte code,
#1 = Class #2 // annotationtype/Example
..
#3 = Class #4 // java/lang/Object
indicates creation of object of type Class<annotationtype.Example>
pointed by member Class<annotationtype.Example> class
during initialisation phase of class Example
, something functionally equivalent to:
public class annotationtype.Example{
public static Class<annotationtype.Example> class;
{
class = Class.forName("annotationtype.Example")
}
......
}
Is my understanding correct about,
the phase at which object(creation) of type Class<annotationtype.Example>
comes into existence, that is pointed by Example.class
?