Search code examples
javadocumentationjavadoc

How to document my method in Java like Java docs?


I want that when i mouse over a method i would be able to see my documentation of what the method does like when i put the mouse over Java's method I know that /** */ is how its done but:

  1. How do you explain what the Params Stands for?

  2. How do you create a new line, or make a word bold or italic?


Solution

  • In most major IDEs, such as IntelliJ's IDEA, Apache Netbeans or Eclipse; you can type

    /**
    

    and press enter and it will generate the Javadoc for your method, including parameters, return values, etc. You just need to put in the descriptions.

    The same applies for class declarations (the Javadoc comment always relates to the following element)

    For instance

    /**
     * create_instance
     * @param array of attributes for instance containing web, db, arrival_rate, response_time for instance 
     * respectively.
     * @return Instance object
     */