Comments in Dart

Comments are sections of code that won’t be evaluated by the compiler and won’t be executed. Just like in C, Java, JavaScript, and similar languages, comments are created in two ways:

  • Single-line comments are created by adding // before the comment.
  • Multi-line comments are created by adding /* before the comment and */ after it.

For example:

 // this is a comment
 int​ a = 3; ​// this is also a comment
 /* this is also
  a long, long
  comment */

where int a = 3; is regular code (not a comment) and will be evaluated by the compiler and executed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset