10. สิ่งผิดปกติ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 10-7  ตัวอย่างแสดงการโยน โยนต่อ และการรับสิ่งผิดปกติในลำดับการเรียกเมท็อด
 public static void main(String[] a) throws IOException {
   m1("data.txt");
   ...
 }
 private static void m1(String f) throws IOException {
   try {
     m2(f);
     ...
   } catch (FileNotFoundException e) {
     ...
   } catch (MalformedURLException e) {
     ...
   }
   ...
 }
 private static void m2(String f) throws FileNotFoundException,
                           MalformedURLException, IOException {
   m3(f);
   ...
 }
 private static void m3(String f) throws FileNotFoundException,  
                                  MalformedURLException {
   Scanner in = new Scanner(new File(f));
   ...
 }
©2009 S.Prasitjutrakul