You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
displayData(){ /* displayData method to print the default country */
print(country);
}
}
class Car extends Vehicle{ /* class 'Car' inherits class 'Vehicle' */
String country;
Car(String model, int year, this.country) : super(model, year); /* 'model' and 'year' inherited from super class Vehicle */
@override
void displayData(){ /* this method is meant to override the 'displayData' method of the super class, and print a different country 'USA' than the one set default as 'Japan' */