How to document my method in Java like Java docs?

丶灬走出姿态 提交于 2019-12-01 03:06:01
Peter Ilfrich

If you're using Eclipse as IDE, you just need to create a comment with

/**

and press enter and it will generate your code for your Javadoc, 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)

Note:

To attach doc to your method you need to specify method name in comments at the top.

For instance

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

How do you explain what the Params Stands for?

Use @param tag:

/**
 * @param paramName Explanation of the param
 */
public void foo(String paramName);

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

Use standard HTML, i.e. <p></p>, <br/>, <strong> and <em> (or less semantic <b> and <i>)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!