Documentation comment | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Documentation comment

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

5th Dec 2018, 4:34 PM
EthanPlusPlus
EthanPlusPlus - avatar
6 Answers
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!!😊
6th Dec 2018, 1:07 AM
AL Araf
AL Araf - avatar
0
To give a description how they have created the code!!!
5th Dec 2018, 4:40 PM
AL Araf
AL Araf - avatar
0
But cant the single line do the same thing
5th Dec 2018, 4:50 PM
EthanPlusPlus
EthanPlusPlus - avatar
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!!
5th Dec 2018, 5:33 PM
AL Araf
AL Araf - avatar
0
Thanks but what about multi line documentation comment? Are they not the same thing
5th Dec 2018, 6:23 PM
EthanPlusPlus
EthanPlusPlus - avatar
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
7th Dec 2018, 6:31 AM
vlada