Javap

[Updated: Feb 12, 2016, Created: Feb 12, 2016]

Java 

This is java command line tool which comes with JDK.

It disassembles class files and prints a human-readable version of those classes.


Example:

A Java class

public class MyClass {
private int i;

public MyClass (int i) {
this.i = i;
}

public int getI () {
return i;
}

public static void main (String[] args) {
MyClass m = new MyClass(5);
System.out.println(m.getI());
}
}


Let's compile above class and then run javap:

D:\examples>javac MyClass.java

D:\examples>javap MyClass
Compiled from "MyClass.java"
public class MyClass {
public MyClass(int);
public int getI();
public static void main(java.lang.String[]);
}



Reference:
javap reference

See Also