Guest User

Untitled

a guest
Dec 21st, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. /**
  2.  * contoh assertion error handling
  3.  *
  4.  * @author affllah14
  5.  * @version 1.0
  6.  */
  7.  
  8. class bagiNol {
  9.     public static void main(String args[]) {
  10.         int num1, num2;
  11.         try {
  12.             num1 = 0;
  13.             num2 = 55 / num1;
  14.             System.out.println(num2);
  15.         }
  16.         catch (ArithmeticException e) {
  17.             System.out.println("Tidak terdefinisi");
  18.         }
  19.         catch (Exception e) {
  20.             System.out.println("Pengecualian");
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment