document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. class Pelanggan {
  2.  
  3.     private final int NomorAntri;
  4.     private String TiketAntri;
  5.     private final int TipeQueue;
  6.  
  7.     public Pelanggan(int NomorAntri, int TipeQueue) {
  8.         this.NomorAntri = NomorAntri;
  9.         this.TipeQueue = TipeQueue;
  10.         this.BuatTiketQueue();
  11.     }
  12.  
  13.     private void BuatTiketQueue() {
  14.         StringBuilder queue = new StringBuilder();
  15.  
  16.         if (this.TipeQueue == 1) queue.append("T");
  17.         else queue.append("C");
  18.  
  19.         queue.append(String.format("%03d", this.NomorAntri));
  20.  
  21.         this.TiketAntri = queue.toString();
  22.     }
  23.  
  24.     @Override
  25.     public String toString() {
  26.         return this.TiketAntri;
  27.     }
  28.  
  29. }
');