public class scope { public static void main (String[] args) { if (args.length > 0) { try { foo(); } catch (Exception e) { System.out.println("catch 1"); } } else { try { foo(); } catch (Exception e) { System.out.println("catch 2"); } } } static void thrower() { throw new RuntimeException(); } static void foo() { thrower(); } }