最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

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

作業(yè)寫(xiě)完了

package Demo;


import java.util.Scanner;


public class BorrowBook {


public static void main(String[] args) {

BorrowBook test=new BorrowBook();

test.bobo();

}

public void bobo(){

String Books[]= {"數(shù)據(jù)結(jié)構(gòu)","高數(shù)","java語(yǔ)言","英語(yǔ)"};

System.out.println("*******歡迎來(lái)到慕課網(wǎng)借書(shū)系統(tǒng)*******");

System.out.println("輸入命令:1-按照名稱(chēng)查找圖書(shū);2-按照序號(hào)查找圖書(shū)");

Scanner input=new Scanner(System.in);

try{

int num=input.nextInt();

if(num==1){

System.out.println("輸入圖書(shū)名稱(chēng):");

Scanner input1=new Scanner(System.in);

String Bookname =input1.nextLine();

int a=-1;

for(int i=0;i<Books.length;i++) {

if(Books[i].equals(Bookname)) {

System.out.println("book:"+Books[i]);

System.out.println("*************您借書(shū)成功*************");

a=1;

}

}

if(a==-1) {

throw new NobookException("圖書(shū)不存在!");

}

}else if(num==2){

System.out.println("輸入圖書(shū)名序號(hào):");

Scanner input2=new Scanner(System.in);

? ? int Booknum =input2.nextInt();

if(Booknum>0&&Booknum<=Books.length) {

System.out.println("book:"+Books[Booknum-1]);

System.out.println("*************您借書(shū)成功*************");

}else {

throw new NobookException("圖書(shū)不存在!");

}

}

}catch(NobookException e) {

System.out.println(e.getMessage());

bobo();

// }catch(ErrorCodeException e){

// ? ? System.out.println("命令輸入錯(cuò)誤!請(qǐng)根據(jù)提示輸入數(shù)字命令");

// bobo();

}catch(Exception e){

? ? System.out.println("命令輸入錯(cuò)誤!請(qǐng)根據(jù)提示輸入數(shù)字命令");

bobo();

}

}

}


正在回答

1 回答

NobookException沒(méi)有定義啊

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

慕絲4409378 提問(wèn)者

有,我沒(méi)有粘貼進(jìn)來(lái)
2019-04-16 回復(fù) 有任何疑惑可以回復(fù)我~
#2

慕絲4409378 提問(wèn)者

package Demo; public class NobookException extends Exception{ /** * */ private static final long serialVersionUID = -5060344282003049736L; String message; public NobookException(String ErrorMessage ) { message =ErrorMessage; } public String getMessage() { return message; } }
2019-04-16 回復(fù) 有任何疑惑可以回復(fù)我~
#3

慕絲4409378 提問(wèn)者

package Demo; public class NobookException extends Exception{ String message; public NobookException(String ErrorMessage ) { message =ErrorMessage; } public String getMessage() { return message; } }
2019-04-16 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

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

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

進(jìn)入課程

作業(yè)寫(xiě)完了

我要回答 關(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)