亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

為什么會報錯呢,報錯類型如下,代碼如下

為什么會報錯呢,報錯類型如下,代碼如下

慕的地1533170 2016-04-06 16:33:09
報錯類型:Exception in thread "main" java.util.NoSuchElementException代碼:public class text { public static void main(String[] args) { // TODO Auto-generated method stub? ? Scanner input=new Scanner(System.in);? ? System.out.println("***************歡迎使用鄭鄭租車系統**************");? ? System.out.println("本公司提供小轎車,小客車,貨車的租用");? ? for(int i=1;i<=3;i++){? ? System.out.println("請輸入你要租用的車型:");? ? String name=input.next();? ? if("小轎車".equals(name)){? ? Zuche text=new 小轎車();? ? text.nums();? ? text.message();? ? continue;? ? }if("小客車".equals(name)){? ? Zuche text1=new 小客車();? ? text1.nums();? ? text1.message();? ? continue;? ? }if("貨車".equals(name)){? ? Zuche text=new 貨車();? ? text.nums();? ? text.message();? ? continue;? ? }? }? ? input.close(); ?}}
查看完整描述

2 回答

?
Its_forever

TA貢獻361條經驗 獲得超328個贊

個人覺得沒問題呢。除了你放蕩不羈的用漢字作為對象名稱。

查看完整回答
反對 回復 2016-04-06
  • 慕的地1533170
    慕的地1533170
    哈哈哈,這幾個單詞不會拼就直接用漢字了。我運行報錯了呢,好困惑
  • 2 回答
  • 0 關注
  • 1344 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號