HelloWorld.java:34: error: class, interface, or enum expected 是什么意思
HelloWorld.java:34: error: class, interface, or enum expected }
HelloWorld.java:34: error: class, interface, or enum expected }
2018-04-15
//34行:错误:类、接口或enum,, import java.util.Arrays; public class HelloWorld { //完成 main 方法 public static void main(String[] args) { HelloWorld hello=new HelloWorld (); int []shuzu={89,-23,64,91,119,52,73}; hello.getshuzu(shuzu); } //定义方法完成成绩排序并输出前三名的功能 public static void getshuzu(int[] shuzu){ Arrays.sort(shuzu); int sum=0; for(int i=shuzu.length-1;i>=0;i--){ if((shuzu[i]<0)||(shuzu[i]>100)) continue; System.out.println(shuzu[i]); sum++; if(sum==3) break; } } }
举报