Variables and Data Types in Dart

 Variables and Data Types in Dart


Variables are used to store data in a program. In Dart, variables can be declared using the var keyword. Dart supports several data types, including int, double, bool, and String.


void main() {

  var name = 'John Doe';

  var age = 25;

  var height = 1.75;

  var isStudent = true;


  print('Name: $name');

  print('Age: $age');

  print('Height: $height');

  print('Is Student: $isStudent');

}

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...