第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

newExc.initCause(e); initCause是什么意思?用來(lái)干嘛的

public class ChainTest {

?public static void main(String[] args) {
??ChainTest ct = new ChainTest();
??try{
???ct.test2();
??}catch(Exception e){
???e.printStackTrace();
??}
?}
?public void test1() throws DrunkException{
??throw new DrunkException("喝車(chē)別開(kāi)酒");
?}
?public void test2(){
??try {
???test1();
??} catch (DrunkException e) {
???
???RuntimeException newExc =
????new RuntimeException(e);
???//newExc.initCause(e);
???throw newExc;
??}
?}


正在回答

1 回答

test1()函數(shù)拋出的是DrunkException異常,test2()函數(shù)調(diào)用了test1()并對(duì)test1()中的異常進(jìn)行了處理,拋出的是RuntimeException異常,initCase(e)說(shuō)明了test2()拋出的RuntimeException是由于DrunkException異常引起的。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Java入門(mén)第三季
  • 參與學(xué)習(xí)       409768    人
  • 解答問(wèn)題       4510    個(gè)

Java中你必須懂得常用技能,不容錯(cuò)過(guò)的精彩,快來(lái)加入吧

進(jìn)入課程

newExc.initCause(e); initCause是什么意思?用來(lái)干嘛的

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)