Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个包含整数的数组,那么将它们从最小到最大排序的最佳方法是什么?
谢谢!!!
很容易:
int[] intarray; // ... Arrays.sort(intarray);
如果您有一个列表:
List<Integer> numbers; // ... Collections.sort(numbers);
int[] x= new int[] {1,2,3,4,0,-3}; Arrays.sort(x); for(int temp: x) { System.out.println( temp); }