Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ExceptionHandling3 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int num = input.nextInt();
- try {
- System.out.println("num : " + num);
- int result = 64 / num;
- int c[] = new int[5];
- c[6] = 1;
- } catch (ArithmeticException e) {
- System.out.println(e);
- } catch (ArrayIndexOutOfBoundsException e) {
- System.out.println(e);
- }
- System.out.println("try-catch sonrası kodlar");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement