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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

求助,大神幫忙看看

求助,大神幫忙看看

Tanh 2017-04-11 10:43:57
import java.util.Arrays;;public class ScoreSort { int[] scores={89,-23,64,91,119,52,73}; public static void main(String[] args) { System.out.println("考試成績(jī)的前三名為:"); ScoreSort a = new ScoreSort(); a.showTop3(scores); } public void showTop3(int []scores){ Arrays.sort(scores); int num=0; for(int i=scores.length-1;i>=0;i++){ if(scores[i]<0||scores[i]>100){ continue; } num++; if(num<=3) System.out.println(scores[i]); else break; } } }為什么a.showTop3(scores); 括號(hào)內(nèi)score會(huì)報(bào)錯(cuò)Cannot make a static reference to the non-static field scores,要怎么改
查看完整描述

1 回答

已采納
?
younghu

TA貢獻(xiàn)25條經(jīng)驗(yàn) 獲得超6個(gè)贊

這是基礎(chǔ)啊, ?你score 數(shù)組不是靜態(tài)的 ! 在scores前價(jià)格static好了

查看完整回答
反對(duì) 回復(fù) 2017-04-11
  • 1 回答
  • 0 關(guān)注
  • 1249 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

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