【发布时间】:2016-06-24 10:59:09
【问题描述】:
我有关于编写标准 javadoc cmets 的问题。 他们要求我们尽可能具体并使用谓词来描述代码,但是如果我在注释中写了一个变量“d”,但在我的代码中没有指明,那会不会有问题?
再一次,我问这个问题是因为我很困惑,而且我的老师对注释代码很严格。
/**
* Find the great common divisor between a 2 number.
*
* @param a number1
* @param b number2
* @return (\max d; ; a % d == 0 && b % d == 0)
**/
public static int GCD(int a, int b) {
if (b == 0) {
return a;
}
return GCD(b, a % b);
}
【问题讨论】: