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

Pagination with Bloc Pattern in Flutter

Pagination First Practical in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter