ya_zay4eg

level_09_02_example_perehvat_isk_del_na_0

Jan 11th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public class ExceptionExample2
  2. {
  3.     public static void main(String[] args)
  4.     {
  5.         System.out.println("Program starting.");
  6.         try
  7.         {
  8.             System.out.println("Before method1 calling,");
  9.            
  10.             method1();
  11.             System.out.println("After method1 calling. Never showed.");
  12.         }
  13.         catch (Exception e)
  14.         {
  15.             System.out.println("Exception catched.");
  16.         }
  17.        
  18.         System.out.println("Program is still running.");
  19.         }
  20.         public static void method1()
  21.         {
  22.             int a = 100;
  23.             int b = 0;
  24.             System.out.println(a / b);
  25.         }
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment