var, final and const
var infers a type and can change. final is set once and const is a compile time constant.
Example
var name = "Ada";
final now = DateTime(2026, 3, 15);
const pi = 3.14159;
name = "Kofi";
print("$name ${now.year} $pi");Exercise
Set once.
x = 5;Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.