Untitled

 avatar
user_8515817
dart
9 days ago
289 B
3
Indexable
class Mobil {
  String tipe;
  int tahun;

  Mobil(this.tipe, this.tahun);

  void info () {
    print('Mobil $tipe tahun $tahun');
  }
}

void main () {

   Mobil mobil = Mobil('Sedan', 2020);
   Mobil mobil2 = Mobil('SUV', 2021);

   mobil.info();
   mobil2.info();

}
Leave a Comment