+ 1

For what sort of documentation comments are ....in java ??

11th Jun 2019, 12:06 PM
Shivam Singh
Shivam Singh - avatar
1 Answer
+ 3
Apart from what ~ swim ~ said you can also provide more info using the doc-comments Most of them start with a '@' with it's appropriate to name. Some commonly used specifiers are @param (to give description about the parameters of a method), @returns (describes the return value), @throws, @see (adds the See also: XXXX to the documentation). Real world example /** @param n specifies the number to get the result @returns the factorial of the number @see #anotherMethod() This method returns the facotorial of a given number using the recursive method. */ public int f(int n) { return n<2?1:f(n-1); }
11th Jun 2019, 2:11 PM
Seniru - avatar