Last active
December 19, 2015 12:28
-
-
Save vaskoz/5954838 to your computer and use it in GitHub Desktop.
Only gets used when calling a method on an object from an Interface type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InvokeInterface { | |
public void methodA() { | |
Runnable r = new Runnable() { | |
@Override public void run() {} | |
}; | |
r.run(); | |
} | |
} | |
//Compiled from "InvokeInterface.java" | |
//public class InvokeInterface { | |
// public InvokeInterface(); | |
// Code: | |
// 0: aload_0 | |
// 1: invokespecial #1 // Method java/lang/Object."<init>":()V | |
// 4: return | |
// | |
// public void methodA(); | |
// Code: | |
// 0: new #2 // class InvokeInterface$1 | |
// 3: dup | |
// 4: aload_0 | |
// 5: invokespecial #3 // Method InvokeInterface$1."<init>":(LInvokeInterface;)V | |
// 8: astore_1 | |
// 9: aload_1 | |
// 10: invokeinterface #4, 1 // InterfaceMethod java/lang/Runnable.run:()V | |
// 15: return | |
//} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment