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

正文內(nèi)容

java程序設(shè)計(jì)programminginjava-文庫吧

2025-09-14 01:20 本頁面


【正文】 va statements //一條或多條可能產(chǎn)生異常的 java語句。 } ? try 語句后必須跟隨至少一個(gè) catch或 finally語句塊。 11 catch語句塊 ? catch語句塊提供錯(cuò)誤處理。 ?一般格式: catch (SomeThrowableObject variableName) { Java statements } ? SomeThrowableObject:能夠被處理的異常類名,必須是throwable類的子類 ? variableName: 是異常處理程序中能夠引用的代表被捕獲異常的變量名稱。 ? Java statements: 當(dāng)捕獲到異常時(shí)執(zhí)行的 java語句。 12 finally語句塊 ?將先前方法的狀態(tài)清除,并可以將控制轉(zhuǎn)移到程序的其他地方。 ? finally 語句塊無論是否發(fā)生異常都要執(zhí)行。 13 例外處理 ——try ,catch和 finally 語句 1 Try{ 2 // code that might throw a partcular exception 3 }catch(MyExceptionType e){ 4 // code to excute if a MyExceptionType exception is thrown 5 }catch (Exception e){ 6 // code to execute if a general Exception exception is thrown 7 }finally{ } 14 public void writeList() { PrintWriter out = null。 try { (Entering try statement)。 out = new PrintWriter(new FileWriter())。 for (int i = 0。 i size。 i++){ (Value at: + i + = + (i))。 } } catch (ArrayIndexOutOfBoundsException e) { (Caught ArrayIndexOutOfBoundsException: + ())。 } catch (IOException e) { (Caught IOException: + ())。 } finally { if (out != null) { (Closing PrintWriter)。 ()。 } else { (PrintWriter not open)。 } } } } 修改例 62得 writeList()方法,見例 63 15 writeList方法中的 try語句塊的執(zhí)行可能有三種情況: ?出現(xiàn)了 IOException ?出現(xiàn)了數(shù)組越界錯(cuò)誤 ?正常退出 Entering try statement Caught IOException: PrintWriter not open Entering try statement Caught ArrayIndexOutOfBoundsException: 10 = 10 Closing PrintWriter Enteri
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1