Untitled
dzaz
plain_text
9 months ago
419 B
6
Indexable
class Car{
String brand, color;
int speed;
Car(this.brand, this.color, this.speed);
void BrandCar(){
print("Mobil bermerek $brand dengan warna $color dengan kecepatan $speed km/jam");
}
}
void main(){
Car car1 = Car("Toyota","Putih", 120);
Car car2 = Car("Avansa","Hitam", 100);
Car car3 = Car("McLaren","Biru", 204);
car1.BrandCar();
car2.BrandCar();
car3.BrandCar();
}Editor is loading...
Leave a Comment