• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

java doc for private members

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Do we need to generate the java docs for private members also ?

or to generate the java docs for public members is enough ?



Regards,
Pramod
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using the javadoc default (protected) is enough. If you are to use protected then your doc comments should not have links to private members or classes. Because you will get error/warnings when generating javadoc.
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

it's perhaps a little paranoid to ask this, but... when you say you don't generate javadoc for private members, does it mean you just don't GENERATE it or don't you write any

(I have many private methods and would be glad to spare myself some work here...)

Thanks in advance
Sigrid
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh document everything private public you name it - everything. But the javadoc tool, protected is enough.

If you don't document private stuff, you may lose points for documentation. And no one wants that.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
About the documentation i can read the following statement in my assignment:


javadoc style comments must be used for each element of the public interface of each class. You must create a full suite of documentation for the classes of the completed project. This must be generated using the tool "javadoc" and must be in HTML format. Provide javadoc documentation for all classes you write.



So just for the public methods will do i guess. I havae javadoc for each data member and method, regardless of the visibility (private, default, protected, public).

Kind regards,
Roel
 
Sigrid Kajdan
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

thanks for your answers! In fact, after reading the instruction, I also was quite sure that writing javadoc for the public methods was enough... - just like you say, Roel.
But when I read that quite a few people think otherwise, and document the private methods anyway, I wonder whether it would be more safe to do this, too.

Perhaps it's not a must, but like you say K., it counts for the documentation? I guess I'll just do it too, then.

Cheers
Sigrid
 
Don't listen to Steve. Just read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic