class Person { String name; // Property: name int age; // Property: age

// Constructor to initialize properties Person([this.name](<http://this.name/>), this.age);

// Method to display a greeting void greet() { print("Hello, my name is $name and I am $age years old."); } }

void main() { var person = Person("Alice", 30); // Create an object with name "Alice" and age 30 print([person.name](<http://person.name/>)); // Access property: Output: Alice print(person.age); // Access property: Output: 30 person.greet(); // Call method: Output: Hello, my name is Alice and I am 30 years old. }