> Command in java ~ Online tutorial

Command in java

Comments

A comment is text inserted into the programming code for the purposes of explanation to the people working on the code. Comments are ignored by the Java compiler and don't become part of the running program.

Comments take a couple of forms:


single line comments – a single line comment begins with // and continues to the end of the line
o //comment to the end of the line
o println("Finished!");
//we're done! multiple line comments – a multiple line comment begins with /* and continues until the first */
o /* multi-line comment here,possibly over many lines,continuing to the */

o The /* and */ may also be used to create a single line comment, as in

/* this is a comment */


Comments can also be used for removing sections of code from the compiled program. This is useful when debugging. For example, this statement
//println("The sum is: " + a + b);
is completely ignored because it is just a comment, and the last part of the statement

println("The sum is: " /* + a + b */);

is ignored because it is enclosed in /* */ marks.

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: