Thuta Learning
BasicProgrammingbeginner

Syntax & Hello World

Relax. We'll talk through this in plain words — no textbook voice.

The basic structure of a Dart program includes functions, statements, comments, and expressions. You can write comments to make your code easier to read, and expressions are the parts that perform calculations or produce values.

dart
void main() {
  // Single-line comment: one short note
  print('Dart is clear and practical.');

  /*
   Multi-line comment:
   Use this when you need longer notes.
  */
  print(10 + 5);
}

print('...') outputs text, and print(10 + 5) adds 10 and 5 and prints the result. Comments don't produce any program output — they're purely for developers to read.

You should see
Dart is clear and practical. 15

Easy traps

  • Mismatched opening { and closing } braces are one of the most common syntax errors beginners run into.
Syntax & Hello World | Thuta Learning