如何用Java文档记录我的Java方法?

问题描述:

我希望当我将鼠标悬停在一个方法上时,我能够看到我的文档,当我将鼠标放在Java的方法上时,该方法的功能我知道/ ** * /是如何完成的但是:

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. 你如何解释Params代表什么?

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

如何创建新行,或者使用粗体或斜体字?

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


如果你使用Eclipse作为IDE,你只需要用

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

/**

并按回车键,它将为您的Javadoc生成代码,包括参数,返回值等。您只需需要输入说明。

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.

同样适用于类声明(Javadoc注释总是与以下元素相关)

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

注意:

要将doc附加到您的方法,您需要在顶部的注释中指定方法名称。

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

例如

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