RickyS20_

Untitled

Dec 21st, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. public class TestBalokDenganException {
  2.  
  3.  public static void main(String[] args) {
  4.  
  5.   try{
  6.    
  7.    BalokDenganException balok1 = new BalokDenganException(8.7, 2.8, 1.7);
  8.    BalokDenganException balok2 = new BalokDenganException(5.2, 3.6, 1.5);
  9.    BalokDenganException balok3 = new BalokDenganException(3.9, 2.7, 1.7);
  10.    BalokDenganException balok4 = new BalokDenganException(9.8, 6.7, 3.4);
  11.    BalokDenganException balok5 = new BalokDenganException(-5.6, 3.9, 1.6);
  12.   }
  13.   catch(IllegalArgumentException ex){
  14.    System.out.println(ex);
  15.   }
  16.  
  17.   System.out.println("Jumlah objek yang dibuat: " +
  18.     BalokDenganException.getJumlahObjek());
  19.  }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment