metadeck
10/4/2018 - 10:13 AM

Beginners Dart - Constant Variables

Beginners Dart - Constant Variables

void main() {

//Here we see a constant variable, trying to change this variable in further code will cause a compiler error

  const String planetEarth = "Earth";

  print(planetEarth);

  planetEarth = "Mars";
  
  print(planetEarth);

}