?java数组排序

2019年2月14日20:04:10 发表评论 935 views
/**
 * Created by xabcd on 2019/2/14.
 */
import java.util.*;
public class java_arrayline
{public static void main(String args[])
{
    int i;
    int a[] = {25, 24, 12, 76, 98, 101, 90, 28};
    System.out.println(a);
    Arrays.sort(a);
    System.out.println(a);
    for(i=0;i<a.length;i++)
        System.out.println(a[i]);
}
}







结果:
[I@4554617c
[I@4554617c
12
24
25
28
76
90
98
101

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: