MeshWorld India LogoMeshWorld.
others1 min read

Dart - Semicolons

Vishnu
By Vishnu
Dart - Semicolons

Semicolons in Dart are mandatory. The semicolon acts as statements terminator. That is every statement must be ended with a semicolon(;).

Dart also allows multiple statements in a single line, exception that every statement must be ended by a semicolon(;). Otherwise a compile-time error will be raised by a compiler.

int x = 45;

String planet = 'Earth 🌏';

// double type
var weight = 52.22;

Every statement in above examples are ended by a semicolon.

In Dart, we can also write more than one statement on the same line, separated by semicolon(;). Check below provided example:

String name = 'Scarlett Johansson'; double height = 1.6;

Hope you like this!

Keep helping and happy 😄 coding

Share_This Twitter / X
Vishnu
Written By

Vishnu

Founder & Principal Architect at MeshWorld. Senior engineer and instructor specializing in AI agent systems, scalable web architecture, and modern development workflows.

Enjoyed this article?

Support MeshWorld and help us create more technical content