How are line comments and block comments used?

What will be an ideal response?


A line comment is included as documentation to the programmer or a programmer that might need to modify the code at some later date. A line comment is signified by //. Anything that follows the // is considered a comment by the compiler until the end of the line is reached.
A block comment is included as documentation to users of the class. Users of the class are usually other programmers. A block comment begins with /* and ends with */. A block comment my span many lines. Any text between the beginning /* and the ending */ is part of the block comment. A special block comment can be used with Javadoc, a documentation tool included in Java’s SDK, to create documentation for users of the class.

Computer Science & Information Technology

You might also like to view...

Answer the following questions true (T) or false (F)

1. When you write ifstream inStream; inStream.open(”infile.dat”); the file, infile.dat must be located in the directory where the program is being run. 2. When you use the open member function to tie a file name to a file stream, the file name is called the external file name, and the program refers to the file by the stream name.

Computer Science & Information Technology

What is the data rate for Fast Ethernet?

a. 10Mbps b. 100Mbps c. 1000Mbps d. 10Kbps e. None of these answers is correct.

Computer Science & Information Technology

Which term is used for a message in its original format?

A. Encryption B. Decryption C. Ciphertext D. Plaintext

Computer Science & Information Technology

Bluetooth is a de facto industry standard for short-range wireless communications between devices.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology