Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: Adding comments using javadoc

  1. #1
    rome99 is offline Member
    Join Date
    Jul 2014
    Rep Power

    Default Adding comments using javadoc

    I would like to add comments at each method (like purpose, input params, return params etc.,) and at class level.
    Should I do manually? or Can I use javadoc to generate something stuff? The thing is it's not like we're going to code now most of the project work is done. So, need to add comments for existing code. Thanks.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: Adding comments using javadoc

    What type of comments are you talking about? If you're talking about something like this:

    Java Code:
    * Returns the thing.
    * @return the thing
    public void getTheThing(){
       return theThing;
    Then sure, you can use an IDE to automatically generate those comments. I'm not sure why you would want to.

    But if you're talking about more substantive comments, then you're going to have to write them manually as we haven't invented telepathic computers just yet.
    gimbal2 likes this.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: Adding comments using javadoc

    I'd put it differently.

    Do you want to achieve the technical result of having javadocs on all your methods?


    do you want to achieve the goal of having properly documented code?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    rome99 is offline Member
    Join Date
    Jul 2014
    Rep Power

    Default Re: Adding comments using javadoc

    yeah, I know IDE does...I have to explore a little more. Thanks Kevin.

Similar Threads

  1. Extracting comments
    By tauraus in forum Advanced Java
    Replies: 1
    Last Post: 04-27-2012, 01:22 PM
  2. Timed Comments
    By StrangeFlow in forum Java Applets
    Replies: 3
    Last Post: 01-18-2012, 05:38 AM
  3. Are my comments correct?
    By twiggy62 in forum New To Java
    Replies: 2
    Last Post: 02-08-2010, 05:34 AM
  4. Javadoc Comments Demo
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-23-2008, 08:07 PM
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-19-2007, 08:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts