




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
W3(a) Lecture Notes (Skrentny) Material Type: Notes; Class: Introduction to Data Structures; Subject: COMPUTER SCIENCES; University: University of Wisconsin - Madison; Term: Spring 2014;
Typology: Study notes
1 / 8
This page cannot be seen from the preview
Don't miss anything!





throw exceptionObject ;
public class ExceptionTester { public static void main (String[] args) { System.out.print("main["); try { methodA( ); System.out.print("after A,"); methodE( ); System.out.print("after E,"); } catch (RedException exc) { System.out.print("red,"); } catch (GreenException exc) { System.out.print("green,"); } finally { System.out.print("finally,"); } System.out.println("]main"); } private static void methodA ( ) { System.out.print("\nA["); try { methodB( ); System.out.print("after B,"); } catch (BlueException exc) { System.out.print("blue,"); } System.out.println("]A"); } private static void methodB ( ) { System.out.print("\nB["); methodC( ); System.out.print("after C,"); try { methodD( ); System.out.print("after D,"); } catch (YellowException exc) { System.out.print("yellow,"); throw new GreenException(); } catch (RedException exc) { System.out.print("red,"); } finally { System.out.print("finally,"); } System.out.println("]B"); }
main[ A[ B[
main[ A[ B[
main[ A[ B[
main[ A[ B[
main[ A[ B[
main[ A[ B[
main[ A[ B[