HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to DartVariablesData TypesOperatorsStringsListsConditions (if / else)Loops (for / while)Functions
REFERENCE
📖 Overview
🖥️ Output
📦 Variables & Types
varfinal / constint.parse() / toString()
🔢 Numbers & Math
✍️ String
📚 List & Map
🔀 Condition & Loop
🧩 Function
Dart›REFERENCE›Variables & Types›final / const

final / const

Defines an immutable (constant) value.

Syntax

final name = value;  //  const name = value;

Description

final is assigned once and cannot be changed later. const is for values that are compile-time constants. Neither can be reassigned a second time.

Example

Loading editor…

Expected output

HexLibrary
3.14

When to use?

Values that will not change (constants, settings).

Common mistakes

  • ⚠️ Assigning a second time to a final/const variable causes a compilation error.

Related commands

var
← varint.parse() / toString() →
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code