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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

下面的藍屏程序哪里出錯?報錯顯示內(nèi)部類不能有靜態(tài)聲明。無法引用this

下面的藍屏程序哪里出錯?報錯顯示內(nèi)部類不能有靜態(tài)聲明。無法引用this

qq_丘比特_0 2016-04-10 22:14:47
?class??LanPingException??extends??Exception{ ?LanPingException???(String??message) ?{ ?super(?message); ?{ class??MaoYanException??extends??Exception { MaoYanException???(String??message) ?{ ?super(?message); } class??NoPlanException??extends??Exception { NoPlanException???(String??msg) ?{ ?super(?msg); ? ? ? ? ? ?}class??Computer{private???int???state=3;public??void??run()throws??LanPingException,MaoYanException{ if(state==2) throw?new??LanPingException("藍屏了"); if(state==3) throw?new??MaoYanException("冒煙了"); System.out.println("電腦運行");}public??void??reset(){ state=1; System.out.println("電腦重啟");}} class???Teacher { private??String??name; private??Computer??cmpt??; Teacher(String?name) { this.name=name; cmpt=new??Computer(); } public??void??prelect()?throws???NoPlanException { try { cmpt.run(); } catch(?LanPingException?e) { cmpt.reset(); } catch?(?MaoYanException?e)??? { test(); throw??new???NoPlanException("課時無法繼續(xù)"+e.getMessage()); } System.out.println("講課"); } public???void??test() { System.out.println("lianxi"); } } class??ExceptionTest { public???static??void??main(String[]??args) { Teacher???t=new???Teacher("畢老師"); try { t.prelect(); } catch?(NoPlanException?e) { System.out.println(e.toString()); System.out.println("換老師或者放假"); } } ?}} } ?} ?}} ?class??LanPingException??extends??Exception{ ?LanPingException???(String??message) ?{ ?super(?message); ?{ class??MaoYanException??extends??Exception { MaoYanException???(String??message) ?{ ?super(?message); } class??NoPlanException??extends??Exception { NoPlanException???(String??msg) ?{ ?super(?msg); ? ? ? ? ? ?}class??Computer{private???int???state=3;public??void??run()throws??LanPingException,MaoYanException{ if(state==2) throw?new??LanPingException("藍屏了"); if(state==3) throw?new??MaoYanException("冒煙了"); System.out.println("電腦運行");}public??void??reset(){ state=1; System.out.println("電腦重啟");}} class???Teacher { private??String??name; private??Computer??cmpt??; Teacher(String?name) { this.name=name; cmpt=new??Computer(); } public??void??prelect()?throws???NoPlanException { try { cmpt.run(); } catch(?LanPingException?e) { cmpt.reset(); } catch?(?MaoYanException?e)??? { test(); throw??new???NoPlanException("課時無法繼續(xù)"+e.getMessage()); } System.out.println("講課"); } public???void??test() { System.out.println("lianxi"); } } class??ExceptionTest { public???static??void??main(String[]??args) { Teacher???t=new???Teacher("畢老師"); try { t.prelect(); } catch?(NoPlanException?e) { System.out.println(e.toString()); System.out.println("換老師或者放假"); } } ?}} } ?} ?}} ?
查看完整描述

1 回答

?
慕粉_編程新手

TA貢獻6條經(jīng)驗 獲得超0個贊

內(nèi)部類不能聲明類變量和類方法。

查看完整回答
反對 回復(fù) 2016-05-07
  • 1 回答
  • 0 關(guān)注
  • 1259 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

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