"javap -private" - Listing Private Variables and Methods

This section provides a tutorial example of how to list all private and public variables and methods of a class with 'javap' with the '-private' option.

From the previous tutorial, we learned that the default behavior of the "javap" command is to list all public variables and methods of the specified class.

If you want to list both public and private variables and methods, you can use the "javap" command with the "-private" option:

herong> javap -private Circle

Compiled from "Circle.java"
public class Circle extends java.lang.Object{
    public java.lang.String uom;
    private int x;
    private int y;
    private int r;
    public Circle();
    public void setRadius(int);
    public void setCenter(int, int);
    public void printRadius();
    public void printArea();
    private double getArea();
}

As you can see from the output, all private and public variables and methods are printed by the "javap" command.

Table of Contents

 About This Book

 Java Tools Terminology

 Java Tools Included in JDK

 javac - The Java Program Compiler

 java - The Java Program Launcher

 jar - The JAR File Tool

 jlink - The JRE Linker

 jmod - The JMOD File Tool

 jimage - The JIMAGE File Tool

 jpackage - Binary Package Builder

 javadoc - The Java Document Generator

 jdeps - The Java Class Dependency Analyzer

 jdeprscan - The Java Deprecated API Scanner

 jdb - The Java Debugger

 jcmd - The JVM Diagnostic Tool

 jconsole - Java Monitoring and Management Console

 jstat - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jhsdb - The Java HotSpot Debugger

 jvisualvm (Java VisualVM) - JVM Visual Tool

 jmc - Java Mission Control

javap - The Java Class File Disassembler

 javap - Java Disassembler Command and Options

 javap - Listing Public Variables and Methods

"javap -private" - Listing Private Variables and Methods

 "javap -c -private" - Disassembling Java Bytecode Class

 Looking Up Method Signature with javap Command

 keytool - Public Key Certificate Tool

 jarsigner - JAR File Signer

 jshell - Java Language Shell

 jrunscript - Script Code Shell

 Miscellaneous Tools

 native2ascii - Native-to-ASCII Encoding Converter

 JAB (Java Access Bridge) for Windows

 Archived Tutorials

 References

 Full Version in PDF/EPUB