Documentation comment | Sololearn: Learn to code for FREE!

0

Documentation comment

Why would one ever use a documentation comment over a single line or multi line comment?

12/5/2018 4:34:28 PM

EthanPlusPlus

6 Answers

New Answer

0

No they are not same!! with multiple line comment you can start from the any of line between ending and starting of the comment!! Whereas you have to complete your comment within one line if you use single line comment!!😊

0

To give a description how they have created the code!!!

0

But cant the single line do the same thing

0

Sometimes the creators give a little description of the questions of the code!! so they need to start from a new line and it's not possible by single line comment!! If They use single line comment they have to add it again and again but if they use the multiple line comment, they don't have to use it again and again!!

0

Thanks but what about multi line documentation comment? Are they not the same thing

0

No, they are not. The JDK javadoc tool uses doc comments when preparing automatically generated documentation. You can find more about it here: https://www.oracle.com/technetwork/java/javase/documentation/index-137868.html