Skip to content

Instantly share code, notes, and snippets.

@considerate
Last active June 1, 2017 22:49
Show Gist options
  • Save considerate/7020d281f3cb10c576bfe79138229b78 to your computer and use it in GitHub Desktop.
Save considerate/7020d281f3cb10c576bfe79138229b78 to your computer and use it in GitHub Desktop.
Compiled from "Test.java"
public class Test {
public Test();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: new #2 // class Test$Specific
7: dup
8: aload_0
9: invokespecial #3 // Method Test$Specific."<init>":(LTest;)V
12: invokevirtual #4 // Method Test$Specific.getMe:()Ljava/lang/Object;
15: astore_1
16: getstatic #5 // Field java/lang/System.out:Ljava/io/PrintStream;
19: aload_1
20: invokevirtual #6 // Method java/lang/Object.getClass:()Ljava/lang/Class;
23: invokevirtual #7 // Method java/lang/Class.getName:()Ljava/lang/String;
26: invokevirtual #8 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
29: return
public static void main(java.lang.String[]);
Code:
0: new #9 // class Test
3: dup
4: invokespecial #10 // Method "<init>":()V
7: pop
8: return
}
public class Test {
class Specific {
public Object getMe() {
return this;
}
}
public Test() {
Object o = new Specific().getMe();
System.out.println(o.getClass().getName()); //Test$Specific
}
public static void main(String[] args) {
new Test();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment