Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Comments | First Acquaintance with Dart
Introduction to Dart
course content

Зміст курсу

Introduction to Dart

Introduction to Dart

1. First Acquaintance with Dart
2. Variables and Data Types
3. Conditional Statements
4. List and String
5. Loops

book
Comments

Developers often need a tool to make their code easier to understand. It’s often helpful for himself and the people he works with on code. A comment is a text that the Dart interpreter ignores, allowing us to explain parts of the code. There are several main uses for comments.

An explanation of what the code does:

dart

main

copy
123
void main() { print('Correct'); // Output word correct to console }

We often comment out code blocks to avoid errors at runtime:

dart

main

copy
12345
void main() { print('Hello, World!'); //; print Hello, World!"'() print("Hello, World!"); }

Code Syntax

Dart supports single-line comments // and multi-line comments /* */.

Single-line comment:

dart

main

copy
123
void main() { print('info'); // Output 'info' to console }

Multi-line comment:

dart

main

copy
12345
void main() { /* multi-line comment */ print("Very useful topic"); }
How many times will the word Dart be displayed in the console?

How many times will the word Dart be displayed in the console?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
We're sorry to hear that something went wrong. What happened?
some-alt