Advertisement
ahmfarisi

Dart PBO Part 4

Sep 18th, 2024 (edited)
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.29 KB | None | 0 0
  1. mixin Pencatat {
  2.   void catat(String pesan){
  3.     print('Catatan : $pesan');
  4.   }
  5. }
  6.  
  7. class Orang with Pencatat {
  8.   String nama;
  9.  
  10.   Orang(this.nama);
  11.  
  12.   void sapa(){
  13.     catat('Halo, nama saya $nama');
  14.   }
  15. }
  16.  
  17. void main(){
  18.   var objOrang = Orang('Faris');
  19.   objOrang.sapa();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement