DEV Community

Cover image for Data types and varialbles
Coder
Coder

Posted on

Data types and varialbles

dart

void main() {
  print("Om Namah Shivay");
  //Data Types and Variables
  //Numbers
  int age = 16;
  print('age: $age');
  double pi = 3.14;
  print('pi: $pi');
  num number = 3.14;
  print('number: $number');
  number = 56;
  print('number: $number');
  BigInt bigInt = BigInt.parse('123456789012345678901234567890');

  print('bigint: $bigInt');

  //Strings

  String name = 'Mr. Unknown';
  print('name: $name');

  //Boolean
  bool canVote = age >= 18;
  print('canVote: $canVote');

  //var
  var address = 'Mars';
  print('address: $address');
  //dynamic
  dynamic end = 'The End';
  print('end: $end');

  end = 42;
  print('end: $end');
}

Enter fullscreen mode Exit fullscreen mode

I understood

Top comments (0)