Two Laptop Bag*
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 Android Security Essentials Live Lessons this week in the Android 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.
 
Similar Threads
When to use new and newInstance() and what is the difference bet them.
Is System.out.println method calling toString() by default? A strange behavior.
Help with returning one string from three methods of type string?
string question
String literal objects in String pool