freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

清華面向?qū)ο蟪绦蛟O(shè)計(jì):第06章-資料下載頁

2024-10-18 17:16本頁面
  

【正文】 lic成員方法 成員方法 描述 getMessage() 返回當(dāng)前異常的描述性信息,其中主要包括異常類的名稱及有關(guān)異常的簡(jiǎn)短描述。 printStackTrace() 將堆棧的跟蹤信息輸出到標(biāo)準(zhǔn)的輸出流中。在控制臺(tái)方式下 ,標(biāo)準(zhǔn)輸出流指屏幕。 printStackTrack(PrintStream s) 將堆棧的跟蹤信息通過參數(shù) s返回。 fillInstackTrack() 填寫跟蹤信息。 定義異常類 除了異常類必須是 Throwable類的子類之外,建 議最好將定義的異常類作為 Exception的子類,這 樣 Java編譯器才能跟蹤程序中拋出的異常位置。 定義異常類的基本格式: class TestException extends Exception { TestException(){super()。} TestException(String s){ super(s)。} } 應(yīng)用自定義的異常類 //filename: public class Test { public static void main(String[] args) { for (int i=0。i。i++) { try { thrower(args[i])。 (Test\+args[i]+\ didn39。t throw an exception)。 } catch(Exception e){ (Test\+args[i]+\ threw a +()+\n with message:+())。 } } } static int thrower(String s) throws TestException { try { if ((divide)){ int i=0。 return i/i。 } if ((null)) { s=null。 return ()。 } if ((test)) throw new TestException(Test message)。 } finally{ ([thrower(\+s+\)done])。 } } }//end of class Test [thrower(divide)done] Testdivide threw a class with message:/ by zero [thrower(null)done] Testnull threw a classs with message:null [thrower(not)done] Testnot didn39。t throw an exception [thrower(test)done] Testtest threw a class TestException with message:Test message 運(yùn)行這個(gè)程序后,應(yīng)該得下面所示的結(jié)果:
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1