如何用Java文档记录我的Java方法? [英] How to document my method in Java like Java docs?

查看:145
本文介绍了如何用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
 */

这篇关于如何用Java文档记录我的Java方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆