DART – Comments

1 0
Read Time:1 Minute, 11 Second

DART – Comments

A comment is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters.

Wikipedia

Types of Dart Comments: 

  1. Dart Single line Comment.
  2. Dart Multiline Comment.
  3. Dart Documentation Comment.

Dart Single line Comment

Dart single line comment is used to comment on a line until a line break occurs. It is done using a double forward-slash (//). 

//This is a Single Line Comment

Dart Multi Line Comment

Dart Multiline comment is used to comment out a whole section of code. It uses ‘/*’ and ‘*/’ to start and end a multi-line comment respectively. 

/*
This 
is a
Multi line
Comment
*/

Dart Documentation Comment

This is a special type of comment mainly used to generate documentation or reference for a project/software package. Documentation comments are multi-line or single-line comments that begin with /// or /**. Using /// on consecutive lines has the same effect as a multi-line doc comment. The brackets are used to refer to classes, methods, fields, top-level variables, functions, and parameters. The names in brackets are resolved in the lexical scope of the documented program element.

/// This is a Example Of Documentation Comment
/// Dart is cool

In the next lesson, you will learn about Keywords.

Happy
Happy
100 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
100%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

3 thoughts on “DART – Comments

Leave a Reply to Satyaprakash Cancel reply