Bifalgorithm post · Computer science one · The javamain() Method

How are comments written and treated in Java programs?

How are comments written and treated in Java programs? (Computer science one · The javamain() Method) — "Comments can be written in a Java program either as a…

Ideas in this flowchart

  • Comments in a Java program
  • Comments have two forms
  • Single-line comment: //comment
  • Everything after // on the same line is ignored
  • Multiline comment: /* comment */
  • Everything between /* and */ is ignored
  • Comments are ignored in the final executable code
  • The amount of comments does not affect the final executable code
Feed/

How are comments written and treated in Java programs?

No cover

Channel

Computer science one

1 page

"Comments can be written in a Java program either as a single line using two forward slashes, //comment or as a multiline comment using a combination of forward slash and asterisk: /* comment */ . With a single line comment, everything on the line after the forward slashes is ignored. With a multiline comment, everything in between the forward slash/asterisk is ignored. Comments are ultimately ignored so the amount of comments do not have an effect on the final executable code. Consider the following example."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.