調用方法和定義方法那兩行總是報錯
package timu;
import java.util.Arrays;
public class timu {
????? //完成 main 方法
?? public static void main(String[] args) {
?????? System.out.println("考試成績前三名為:");
?????? int[]scores={89,-23,64,91,119,52,73};
?????? timu ice=new timu();
?????? ice.cake(scores);
?????? }
??
?? //定義方法完成成績排序并輸出前三名的功能
?? public void cake =(int[] scores){
?????? Arrays.sort(scores);
?????? int x =0;
?????? for(int i=scores.length-1;i>=0;i--){
?????? if(scores[i]<0||scores[i]>100){
?????? continue;}
?????? x++;
?????? if(x>3){
?????????? break;
?????? }
?????? System.out.println(scores[i]);
?? }
2015-12-11
public void cake =(int[] scores){
方法定義錯誤,沒有 “=”
2015-12-11
public void cake =(int[] scores){
方法定義錯誤,沒有 “=”
2015-12-11
定義方法哪多了個等號
2015-12-11
public void cake =(int[] scores) ? 多了個=號