- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
对于不改变实例状态的函数,该方法的 javadoc 注释通常与 Java-API 中 @return-tag 的注释相同或非常相似。
boolean 集合.isEmpty()
现在我正在为许多简单的方法(如 getExpression())编写 javadoc,但我遇到了同样的问题。我应该像在 API 中那样做还是不做?
最佳答案
来自 Oracle 的建议 How to Write Doc Comments for Javadoc Tool :
@return (reference page)
Omit @return for methods that return void and for constructors; include it for all other methods, even if its content is entirely redundant with the method description. Having an explicit @return tag makes it easier for someone to find the return value quickly. Whenever possible, supply return values for special cases (such as specifying the value returned when an out-of-bounds argument is supplied).
关于Javadoc @return 标记注释重复是否必要?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10088311/
我正在使用 this solution在二进制矩阵中找到与图像边界对齐的矩形。假设现在我想找到一个不与图像边框对齐的矩形,并且我不知道它的方向;找到它的最快方法是什么? 为了示例,让我们寻找一个仅包含
else: 行在这个 Python 程序中是否正确/必要? from random import randrange for n in range(10): r = randrange(0,1
在 TDPL 7.1.5.1 中讨论了将 Widget w2 分配给 w1 并且作者指出“将 w2 逐个字段分配给 w1 会将 w2.array 分配给 w1.array——一个简单的数组边界分配,而
我是一名优秀的程序员,十分优秀!