The whole purpose of creating a Documentation
is for its implementors to be able to understand what you intended to do in your code.
- Should you create
documentation
for everything ? yes
The programmers who plan to use your API
might not understand the "obvious" purpose of a method,property,constructor,class
so, yes, do it even if it is obvious (It might be obvious just to you).
Using @param, @return
annotations
should be used only when this is the case, in your question code example you have:
/**
* Another constructor for class Time1
*/ public Time1 (Time1 other)
{
_hour = other._hour; _minute = other._minute; _second = other._second;
}
So, does your constructor return something ? no, so why use the @return
annotation.
But what your constructor
does have is a parameter, so the correct thing to do here would be:
/**
* Another constructor for class Time1
* @param other <and explain its purpose>
*/
public Time1 (Time1 other)
{
_hour = other._hour; _minute = other._minute; _second = other._second;
}