javap tool
javap is a command which when used with a classname, disassembles that class file. This command displays fields,methods and constructors information which are present in the class file with which javap command is used.
Syntax of javap command:
javap full_class_name
Example to demonstrate javap command:
class Demo
{
public static void main(String args[])
{
System.out.println("hello Demo");
}
}
When javap command is used with Demo class it disassemble the Demo class file.
javap Demo
Output:
Compiled from ".java"
class Demo
{
Demo(); //constructor
public static void main(java.lang.String[]); //method
}
In above output it can be seen that constructor and method with Demo class are displayed when javap command is used with Demo class file. Since there was no constructor in Demo class therefore a default constructor is automatically called with name Demo.
0 Comment(s)