File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Javadoc Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Javadoc Query" Watch "Javadoc Query" New topic

Javadoc Query

Phil Harron

Joined: Jun 21, 2002
Posts: 29
Hi guys, I'm just doing my Javadoc now for the UrlyBird 1.3.1 and was wondering should I write javadoc for every private method and field for each class?

The Spec says ...javadoc must be used for each element of the public interface..


SCJP 1.4<br />SCJD (Ongoing)
Eben Hewitt
Ranch Hand

Joined: Apr 16, 2004
Posts: 36
I know developers who passed with only writing comments for the public methods and constructors, when given the same instructions. So I would imagine that that would be okay.

I wrote Javadoc for private helper methods if their purpose or relation to the rest of the class wasn't immediately self-evident. But that was more for me, in case I wanted to refer to it later.


Eben Hewitt. SCJP, SCWCD, SCJD, SCJWSD for JEE 5, TOGAF 8 Certified Architect, author of Java SOA Cookbook (O'Reilly, 2009) and contributor to 97 Things Every Software Architect Should Know
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi Phil:
I believe javadoc is not required for private methods and fields, however it is good programming practice to document everything. It will make life much easier for whoever going to maintain your code.

SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Robert Konigsberg
Ranch Hand

Joined: Jun 23, 2004
Posts: 172
IN TERMS OF THE EXAM, It's probably helpful to document private methods because the concept is that the product will be passed along to junior developers. At least, that's the way it is on B&S.


SCJP 1.4 (91%)<br />SCJD 1.4 (376/400, 94%)
Ben Ritchie
Ranch Hand

Joined: Nov 18, 2002
Posts: 98
I wrote javadoc for everything - although writing it was really boring

SCJP1.4, SCJD, SCEA (in progress)
Jon Entwistle
Ranch Hand

Joined: Feb 20, 2003
Posts: 118
I played it safe and documented everything and enjoyed every second of it :roll:

[ July 22, 2004: Message edited by: Jon Entwistle ]

Matt Pryor

Joined: Jul 21, 2004
Posts: 2
Another thing to bear in mind is that javadoccing up your code towards the end of the project lifecycle can be a really, really good way of refreshing your memory on how everything works and fits together!

Particularly if you do the assignment over a longish period of time.

[edited for spelling]
[ July 23, 2004: Message edited by: Matt Pryor ]

===========<br /> <br />SCJP (89%)<br />SCJD Pending
I agree. Here's the link:
subject: Javadoc Query
It's not a secret anymore!