不理解,求各位大神道友解答,谢谢谢谢谢.........
package jin;
import java.util.Arrays;
public class HelloWorld1{
public static void main(String[] args){
HelloWorld1 hello = new HelloWorld1();
int[] scores = {89,-23,64,91,119,52,73};
Arrays.sort(scores);
int[] newArrays = hello.getnewArrays(scores);
System.out.println(Arrays.toString(newArrays));
}
public int[] getnewArrays(int[] scores){
for(int i = 0; i<scores.length; i++){
if(scores[i]>100 || scores[i]<0){
continue;
}
int[] newArrays= {scores[i]};
// System.out.println(Arrays.toString(newArrays));
}
return newArrays; //(这里为什么不能返回数组?????)
//(而在方法中设定无返回值,直接输出newArrays就可以! 求解,谢谢谢!!!!)
}
}