Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hello World

  • main
  • print
void main() {
   print("Hello World");
}

dart hello_world.dart

Every Dart script must have a main subroutine that returns void, but we actually don’t need to explicitly mention void.

Statements end with semi-colon: ;

print needs parentheses (as most functions do) and automatically appends a newline at the end of the output.