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

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

請大神看一下,錯誤是:a1 cannot be resolved to a variable。求解釋一下哈

請大神看一下,錯誤是:a1 cannot be resolved to a variable。求解釋一下哈

Rogerl 2015-06-29 12:48:02
package?com.imooc;import?java.util.Scanner;?public?class?BorrowBook?{????String[]?shu={"高數(shù)","大學英語","計算機"};????Scanner?sc?=?new?Scanner(System.in);?public?void?test1(){????System.out.println("輸入命令1或2:1代表按照書名查找圖書;2代表按照序號查找圖書");}?public?void?test2()?throws?Exception{????test1();????int?a1=sc.nextInt();????if?(a1!=1||a1!=2){?????throw?new?Exception("命令輸入錯誤;請根據(jù)提示輸入數(shù)字命令!!");?????}???}public?void?test3()?{??try{??????test2();????}catch(Exception?e){????test3();}if(a1==1){????System.out.println("請輸入圖書名");????String?a2=sc.next();????for(int?i=0;i<3;i++){????????if(a2==shu[i])????????????System.out.println("book:"+a2);????}}????else?if(a1==2)????{????????System.out.println("請輸入圖書序號");????????int?b2=?sc.nextInt();????????for(int?i=0;i<3;i++){????????????if(b2==i)????????????????System.out.println("book:"+shu[i]);????}????System.out.println("圖書不存在");}}}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 2637 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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