+ 1

What is the use of COMMENT tag when it is not get displayed on output <!--why?-->

17th Jan 2018, 11:15 AM
Nyz
Nyz - avatar
4 Answers
+ 1
I used to program strictly in JS and I constantly used comments, just to keep track and explain things I didn't fully understand. For example: System.out.printIn("Hello world!"); //Idk what went wrong!! Later after research you find that it's printLn, not printIn -this is actually my rookie mistake.. like I said, i used JS, not Java- and you can use the comment to easily find the line you were at, and even leave a note for yourself next time! 👍 Hope this helps!
17th Jan 2018, 7:37 PM
Scout Munk
Scout Munk - avatar
+ 11
You can use comments to explain your code, which can help you when you edit the source code at a later date. This is especially useful if you have a lot of code or working with others on a big project.
17th Jan 2018, 11:23 AM
Ranjan Bagri
Ranjan Bagri - avatar
+ 2
The use of COMMENT tag is to making your code understandable for you and as well as for others...
25th Jan 2018, 5:41 AM
swati singh
swati singh - avatar
+ 1
you may not be the one who edits the code later. Maybe you got a new job some where else. Maybe you have to edit someone else's code. having comments explaining what sections were intended to do what will make debugging easier
19th Jan 2018, 4:35 AM
greg