What is a comment? Is the comment ignored by the compiler? How do you denote a comment line and a comment paragraph?

Java Programming Language >   Overview of Java Language >   Tokens in Java  

Short Question

7140


Answer:

Comments are used to document what a program is for and how a program is constructed. Comments help the programmers or users to communicate and understand the program. Comments are not programming statements and are ignored by the compiler. In Java, comments are preceded by two forward slashes (//) in a line or enclosed between /* and */ in multiple lines. When the compiler sees //, it ignores all text after // in the same line. When it sees /*, it scans for the next */ and ignores any text between /* and */.


This Particular section is dedicated to Question & Answer only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.