Difference between norma block comments and javadoc comments

Hello there. I am currently learning java and am wondering the difference between a normal block comment such as /* */ and a javadoc comment. Please help. Thanks.

Normal Block is like the standard comment in java.
It’s used just to comment out a block of code or add some explanation to what the code does.
Anything that you put between /* */ is not executed by Java (so you can use as a form to disable some part of your code).


Now Javadoc is when you need to create a documentation for your code.
It’s a bit different from normalblocks since it uses /** */. Also, Java can use these to generate HTML documentation for you. People usually do this do describe the purpose of something (like methods, variables, programs, etc)
Also, javadoc support tags like @param, @return, @throws, so you can organize better the documentation itself.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.