home *** CD-ROM | disk | FTP | other *** search
Java Source | 1995-12-31 | 443 b | 24 lines |
- /* Finally example (couldn't name class "finally") */
- class finaly {
-
- public static void main(String args[]) {
- System.out.println(tester(20));
- }
-
- public static int tester(int a) {
-
-
- try {
- a = 100/a;
- if (a<10) return 10;
- System.out.println("Yeah! a > 9");
- } catch (ArithmeticException e) {
- System.out.println(e.getMessage());
- }
- finally {
- System.out.println("Try is done");
- }
- return a;
- }
- }
-