It's not a secret anymore!
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
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: 15092

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 8 API documentation
I agree. Here's the link:
subject: javap -c dotclassfilename
It's not a secret anymore!