Some of my classes have a zero-arg public constructor automatically generated. Am I supposed to generate JavaDoc comments for these? The requirements state that I have to have javadoc comments for "each element of the public interface of each class". So is the automatically generated constructor part of the "public interface" or not?
I would comment a constructor, if you use (for example) DependencyInjection to add some needed functional components. There it could be good to comment such constructors. But I would not add any comment to default-constructors. Actually you only could write a comment without any overvalue.
... and javadoc style comments must be used for each element of the public interface of each class
Please remark the must.
Regards M. [ January 15, 2007: Message edited by: Mihai Radulescu ]
Joined: Nov 17, 2006
Yep, but public interface is IMHO the methods that could be could called from outside (not the constructor). I know, that everybody tries to interpret every single word in the assignment. Perhaps Sun wants us to comment all constructors (even the no-arg ones), but I do not see any sense in that.
But I still don't know it of course.
But to be sure, I admit, to add some comments does not hurt. Only "do not provide comments that do not add to the comprehensibility of the code". I have to ask my Mentalo.