Search code examples
javaeclipserefactoringcommentsjavadoc

Is there a way to convert all comments into javadoc comments? [Eclipse/Java]


I'm doing a Java school assignment with Eclipse, and at the very bottom it says all documentation should be in Javadoc, but I already did all my comments using //.

Is there any easier way to do this other than manually going back and changing every comment to Javadoc format /** */?

Thanks.


Solution

  • Javadocs are a specific comment format used to generate external documentation for your code. You shouldn't be converting regular comments to Javadoc.

    For example:

    /**
     * Do foo with a.
     * @param a the a value
     * @return some different value
     * @see #bar
     */
    public String foo(String a) {
        // blah blah blah
    }
    

    See this technical doc for more details.

    If you do want to convert the comments, though, you would have to do it manually like you said. There isn't a specific tool for this.