Ad space (banner)
Lesson 2 / 20

Your first output (print)

This lesson covers the basics of printing in Dart with print().

print() displays text on the screen. Dart's syntax is designed to be readable, and if you have used JavaScript or Java you should pick it up fairly smoothly.

In the sample code, a single line — print('Hello, Dart!'); — sits inside the fixed void main() { ... } frame.

A common early stumble is forgetting to write the main() function. Every Dart program starts running from a function called main() — that is the rule.

In professional work, Dart is being adopted rapidly in mobile development, because the Flutter framework lets one codebase produce both iOS and Android apps.

๐Ÿ“– Reference code
โœ๏ธ Your code
Type your code, then press "Run"

๐Ÿงช This site can't compile or run Dart directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ€” nothing is sent anywhere).

Ad space (banner)
Ad space (in-article)