home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Documents / JAVA Programming / examples / 10 / MultiCatch.java < prev    next >
Encoding:
Java Source  |  2000-09-08  |  380 b   |  17 lines

  1. class MultiCatch {
  2. public static void main(String args[]) { 
  3. try {
  4.      int a = args.length;
  5.      System.out.println("a = " + a);
  6.      int b = 42 / a;
  7.      int c[] = { 1 };
  8.      c[42] = 99;
  9.     } 
  10. catch (ArithmeticException e) {
  11. System.out.println("div by 0: " + e);
  12. catch(ArrayIndexOutOfBoundsException e) { 
  13. System.out.println("array index oob: " + e);
  14. }
  15. } }
  16.