Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaDoc

 
Vengan Krish
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My assignment spec says the final submission must have 'JavaDoc documentation for all classes and interfaces you are submitting'. Here are my questions.
1.Many or most of my classes don't have to be public. Should I make all classes public and include doc comments, to meet the above criteria?
2.I have very few public methods in my classes. They all have package level access or private access. Should I include doc comments for such methods? They are not going to be generated anyway in the javadoc.

Advanced thanks for your response.

Regards
 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to make all classes public. However, I use Javadoc for public, protected, package and private level methods andattributes.
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I also did not make classes public that did not need to be (I think that would be a bad idea that will probably cost you points in the OO or General Considerations categories).

As a habit, I added comments to all methods, even private ones and to all fields that had package level or better visibility. I generated the javadoc using the -package flag. I got the full score in the documentation category, so I guess it was OK.

Frans.
 
Vengan Krish
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all who replied. I'll got the same way as you guys.


Regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic