File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes javap  -c  dotclassfilename Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javap  -c  dotclassfilename" Watch "javap  -c  dotclassfilename" New topic

javap -c dotclassfilename

Niranjan Prasad
Ranch Hand

Joined: Aug 13, 2005
Posts: 62
This is Niranjan

public class First
public static void main(String[] args)
System.out.println("Hello World!");

I have this basic program as
and compile javac
and now I have used the following command
javap -c First
and i got the following in the command prompt.

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

public static void main(java.lang.String[]);
0: getstatic #2; //Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3; //String Hello World!
5: invokevirtual #4; //Method java/io/PrintStream.println Ljava/lang/Str
ing V
8: return


What's all this.

Niranjan.In one of interviews panel has asked me.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13868

It's the decompiled byte code of your class.

Lookup the documentation of the javap tool.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Consider Paul's rocket mass heater.
subject: javap -c dotclassfilename
Similar Threads
small, simple, efficient, cost effective and memory effective java code to print COGN
Query with String statement
Java Code that can not be decompiled
Diiference between String ,StringBuffer & StringBuilder
Inheritance - Object Class