0PricingLogin
Dart Academy · Lesson

var, final, and const Explained

Choose between mutable, run-time, and compile-time values.

Three Ways to Name a Value

In Dart you store data in named boxes called variables. The keyword you pick decides whether that box can ever change.

Meet var

Use var when a value will change later. Dart still figures out the type for you, so var is convenient and safe.

var score = 0;
score = 10;

All lessons in this course

  1. var, final, and const Explained
  2. The Core Types: int, double, String, bool
  3. Type Inference vs Explicit Types
  4. The dynamic and Object Types
← Back to Dart Academy