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
Post a Comment