javap tool in Java with Examples
javap tool
The javap tool is used to get the information of any class or interface. The javap command (also known as the Java Disassembler) disassembles one or more class files. Its output depends on the options used (“-c” or “-verbose” for byte code and byte code along with innards info, respectively). If no options are used, javap prints out the package, protected, and public fields and methods of the classes passed to it.
Syntax:
javap [option] [classname]
When no options are used:
Syntax:
javap class_name
Output:

When Options are used:
The description and implementation of options are given below:
Note: Some options prints very long output which can’t be shown completely. Please try in your System to view the complete output of options used.
- -help or –help or -? :
This option prints a help message for the javap command.
Syntax:javap -help
- -version :
This option prints Version information of java.
Syntax:javap -version
- -v or -verbose :
This option Prints additional information like stack size, number of locals and arguments for methods.
Syntax:javap -v class_name
- -l :
This option prints line number and local variable tables.
Syntax:javap -l class_name
- -public :
This option prints only public classes and members.
Syntax:javap -public class_name
- -protected :
This option prints protected/public classes and members.
Syntax:javap -protected class_name
- -package :
This option prints package/protected/public classes and members (default).
Syntax:javap -package class_name
- -c :
This option prints Disassembled code.
Syntax:javap -c class_name
- -s :
This option prints internal type signatures.
Syntax:javap -s class_name
- -sysinfo :
This option prints system info (path, size, date, MD5 hash) of class being processed.
Syntax:javap -sysinfo class_name
- -constants :
This option prints final constants of class.
Syntax:javap -constants class_name
- How to create a user defined javap tool?
- JSwing | Create a Magnifying tool using Java Robot
- What is JavaDoc tool and how to use it?
- Gradle Build Tool I Modern Open Source Build Automation
- Java.util.LinkedList.poll(), pollFirst(), pollLast() with examples in Java
- Java lang.Long.numberOfLeadingZeros() method in Java with Examples
- Java.lang.Short toString() method in Java with Examples
- Java lang.Long.numberOfTrailingZeros() method in Java with Examples
- Java lang.Long.byteValue() method in Java with Examples
- Java.util.concurrent.RecursiveTask class in Java with Examples
- Java.util.concurrent.RecursiveAction class in Java with Examples
- Java lang.Long.highestOneBit() method in Java with Examples
- Java lang.Long.lowestOneBit() method in Java with Examples
- Java.util.BitSet class methods in Java with Examples | Set 2
- Java.util.concurrent.Phaser class in Java with Examples
References: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javap.html
Recommended Posts:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.












