sort an array - Java

sortArray

Snippet Code


  
Rate this page :
  [ 0 votes]

Sort an array in ascending order.

int[] sampleArray = {30, 10, 50, 20, 40}; Arrays.sort(sampleArray); for(int x:sampleArray) { System.out.println(x); }

Tags


Ask Questions

Ask Question