Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * contoh assertion error handling
- *
- * @author affllah14
- * @version 1.0
- */
- class bagiNol {
- public static void main(String args[]) {
- int num1, num2;
- try {
- num1 = 0;
- num2 = 55 / num1;
- System.out.println(num2);
- }
- catch (ArithmeticException e) {
- System.out.println("Tidak terdefinisi");
- }
- catch (Exception e) {
- System.out.println("Pengecualian");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment