输出乱码问题,急急急~~~~
for (int i=scores.length-1;i>=0;i--){
System.out.println(scores);
}
这个逆序排列输出是乱码怎么回事:
[I@2a139a55
[I@2a139a55
[I@2a139a55
[I@2a139a55
[I@2a139a55
[I@2a139a55
[I@2a139a55
2015-10-07
我的代码应该没问题啊,特意加入正续排列:
package lession;
import java.util.Arrays;
public class 521 {
public static void main(String[] args) {
int [] scores = {89,-23,64,91,119,52,73};
Arrays.sort(scores);
for (int i=0 ; i<scores.length;i++){
System.out.println(scores[i]);
}
System.out.println("********************************");
for (int score : scores){
System.out.println(score);
}
for (int i=scores.length-1;i>=0;i--){
System.out.println(scores);
}
}
}
举报