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

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

麻煩大家看看哪里出錯了???

麻煩大家看看哪里出錯了???

慕粉3988924 2017-02-10 21:53:12
public class HelloWorld {? ? public static void main(String[] args) { HellowWorld hello = new HelloWorld(); int maxScore=hello.getMaxAge(); System.out.println("最大年齡為:" + maxScore);? public int getMaxAge(){ int stuAge[]={18,23,21,19,25,29,17}; ? ? ? ?int max=stuAge[0]; ? ? ? ?for(int i=0;i<stuAge.length;i++){ ? ? ? ? ? ?if(max<stuAge[i]){ ? ? ? ? ? ? ? ?max=stuAge[i]; ? ? ? ? ? ?} ? ? ? ?}? ? ? ? return max; ? ? ? ? ?} }}
查看完整描述

2 回答

已采納
?
習慣受傷

TA貢獻885條經驗 獲得超1144個贊

你怎么能在main方法里面定義方法呢?把getMaxAge方法放到main平級。

查看完整回答
2 反對 回復 2017-02-10
  • 慕粉3988924
    慕粉3988924
    哦哦哦?。?!我看了好久都沒發現!??!十分感謝
  • 2 回答
  • 0 關注
  • 1335 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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