Created
July 9, 2013 04:58
-
-
Save vaskoz/5954821 to your computer and use it in GitHub Desktop.
Calling a static method is the one and only use case of invokestatic.
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 InvokeStatic { | |
public static void someStaticMethod() {} | |
public static void main(String[] args) { | |
someStaticMethod(); | |
} | |
} | |
//Compiled from "InvokeStatic.java" | |
//public class InvokeStatic { | |
// public InvokeStatic(); | |
// Code: | |
// 0: aload_0 | |
// 1: invokespecial #1 // Method java/lang/Object."<init>":()V | |
// 4: return | |
// | |
// public static void someStaticMethod(); | |
// Code: | |
// 0: return | |
// | |
// public static void main(java.lang.String[]); | |
// Code: | |
// 0: invokestatic #2 // Method someStaticMethod:()V | |
// 3: return | |
//} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment