29 }
30
31 public static void test2() throws ClassFormatError {
32 Greeting greeting = new Greeting() {
33 @Override
34 public void sayHello() {
35 System.out.println("Hello from an anonymous inner class!");
36 }
37 };
38
39 greeting.sayHello(); // Calls the method in the anonymous inner class
40 }
41 }
42
43 Nested class acccess flags are made invalid in this jcod file, the inner class is unnamed.
44 */
45
46 class OuterTest2 {
47 0xCAFEBABE;
48 0; // minor version
49 70; // version
50 [] { // Constant Pool
51 ; // first element is empty
52 Method #2 #3; // #1
53 class #4; // #2
54 NameAndType #5 #6; // #3
55 Utf8 "java/lang/Object"; // #4
56 Utf8 "<init>"; // #5
57 Utf8 "()V"; // #6
58 class #8; // #7
59 Utf8 "OuterTest2$1"; // #8
60 Method #7 #3; // #9
61 InterfaceMethod #11 #12; // #10
62 class #13; // #11
63 NameAndType #14 #6; // #12
64 Utf8 "OuterTest2$Greeting"; // #13
65 Utf8 "sayHello"; // #14
66 class #16; // #15
67 Utf8 "OuterTest2"; // #16
68 Utf8 "Code"; // #17
69 Utf8 "LineNumberTable"; // #18
|
29 }
30
31 public static void test2() throws ClassFormatError {
32 Greeting greeting = new Greeting() {
33 @Override
34 public void sayHello() {
35 System.out.println("Hello from an anonymous inner class!");
36 }
37 };
38
39 greeting.sayHello(); // Calls the method in the anonymous inner class
40 }
41 }
42
43 Nested class acccess flags are made invalid in this jcod file, the inner class is unnamed.
44 */
45
46 class OuterTest2 {
47 0xCAFEBABE;
48 0; // minor version
49 71; // version
50 [] { // Constant Pool
51 ; // first element is empty
52 Method #2 #3; // #1
53 class #4; // #2
54 NameAndType #5 #6; // #3
55 Utf8 "java/lang/Object"; // #4
56 Utf8 "<init>"; // #5
57 Utf8 "()V"; // #6
58 class #8; // #7
59 Utf8 "OuterTest2$1"; // #8
60 Method #7 #3; // #9
61 InterfaceMethod #11 #12; // #10
62 class #13; // #11
63 NameAndType #14 #6; // #12
64 Utf8 "OuterTest2$Greeting"; // #13
65 Utf8 "sayHello"; // #14
66 class #16; // #15
67 Utf8 "OuterTest2"; // #16
68 Utf8 "Code"; // #17
69 Utf8 "LineNumberTable"; // #18
|