aspose file tools*
The moose likes Java in General and the fly likes Difference between invokeVirtual , invokeSpecial and invokeStatic in bytecode of java src file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Difference between invokeVirtual , invokeSpecial and invokeStatic in bytecode of java src file." Watch "Difference between invokeVirtual , invokeSpecial and invokeStatic in bytecode of java src file." New topic
Author

Difference between invokeVirtual , invokeSpecial and invokeStatic in bytecode of java src file.

Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 391
Anyone has idea about this difference keyword used in bytecode.


class test extends java.lang.Object{
test();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>")V
4: return

public static void main(java.lang.String[]) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException;
Code:
0: ldc #2; //String java.lang.String
2: invokestatic #3; //Method java/lang/Class.forNameLjava/lang/String;)Ljava/lang/Class;
5: invokevirtual #4; //Method java/lang/Class.newInstance)Ljava/lang/Object;
8: pop
9: new #5; //class java/lang/String
12: dup
13: invokespecial #6; //Method java/lang/String."<init>")V
16: astore_1
17: return

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between invokeVirtual , invokeSpecial and invokeStatic in bytecode of java src file.