int数组排序—Array.sort()


    import java.util.Arrays;
    
    public class ArraysSort {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    
    		int[] array={2,3,4,1,5,7,33,23};
    		Arrays.sort(array);
    		
    		for(Integer num:array) {
    			
    		System.out.print(num+" ");
    		
    		}
    	}
    
    }

RS:
1 2 3 4 5 7 23 33

你可能感兴趣的:(int数组排序—Array.sort())