我這哪里錯(cuò)了
import java.util.Arrays;
public class HelloWorld {
? ??
? ? //完成 main 方法
? ? public static void main(String[] args) {
? ? ? ??
? ? ? ? int[] scores={89,-23,64,91,119,52,73};
? ? ? ?
? ? ? ?HelloWorld hello=mew HelloWorld();
? ? ? ?hello.yu(scores);
? ??
? ? }
? ??
? ? //定義方法完成成績(jī)排序并輸出前三名的功能
? ??
? ??
? ? public void yu(int[] scores){
? ? ? ? Arrays.sort(scores);
? ? ? ? int n=0;
? ? ? ? for(int i=scores.length-1;i>=0;i--){
? ? ? ? ? ? if(scores[i]<0||scores[i]>100){
? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? }
? ? ? ? ? ?
? ? ? ? ? ? ? ? n++;
? ? ? ? ? ? ? ??
? ? ? ? ? ? ?System.out.println(scores[i]);
? ? ? ? ? ? ? ? ?if(n>=3)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }
? ? ? ? ? ? ??
? ? ? ? ? ? }
? ? ? ? ? ?
? ? ? ? ? ??
? ? ? ? }
? ? ? ??
? ? }
? ??
? ??
? ??
? ??
? ??
? ??
? ??
2020-02-29
你的constructor在哪里?還有那個(gè)mew?
2020-02-26
創(chuàng)建對(duì)象
2020-02-25
哈哈,你看一下你創(chuàng)建對(duì)象時(shí)候,new寫成了mew了