Var and Dynamic Keyword

 void main() {

  print("Welcome to Dart");

String name = "Heer";

//var
var subject = "Maths"; // First Value Assignation will be considered

subject = "welcome";

var rollno = 10;

rollno = 15;

var section; // Dynamic Data_Type. Multiple type of data can be Override.
//dynamic section; // This will same work with the above statement.

section = "D"; // String

section = 7; // Integer

section = false; // Boolean

print(section);
}

/// OUTPUT:
/// Welcome to Dart
/// false

Comments

Popular posts from this blog

Second GET API Calling with Bloc simple Example in Flutter

Exception_Dart

Pagination with Bloc Pattern in Flutter