Syntax and types
โ Report an issue with this lessonvoid main() {
String name = "Ada";
int age = 28;
double price = 29.99;
print("$name is $age years old");
}
Dart is statically typed with type inference via var:
var courses = <String>["HTML", "SQL"]; // inferred as List<String>
Try it yourself
Exercise: Declare a String name and int age, then print them with string interpolation.
Expected output: open-ended โ there's no single correct output here, just get your code running without errors.
Run your code and get it working before marking this lesson complete.
// free preview
9 more lessons โ including Capstone project: a course catalog โ plus a certificate are waiting.
Unlock the full course โ $149.99