Horje
sort int array in descending order java Code Example
java sort array descending
Integer[] cubes = new Integer[] { 8, 27, 64, 125, 256 };
Arrays.sort(cubes, Collections.reverseOrder());

Read more: https://www.java67.com/2016/07/how-to-sort-array-in-descending-order-in-java.html#ixzz6MX60xZLb
sort int array in descending order java
// an array of ints
int[] arr = {1, 2, 3, 4, 5, 6};

// an array of reverse sorted ints
int[] arrDesc = Arrays.stream(arr).boxed()
    .sorted(Collections.reverseOrder())
    .mapToInt(Integer::intValue)
    .toArray();

System.out.println(Arrays.toString(arrDesc)); // outputs [6, 5, 4, 3, 2, 1]




Java

Related
java sort int array Code Example java sort int array Code Example
How to connect from Android emulator to application on localhost? Code Example How to connect from Android emulator to application on localhost? Code Example
java reverse loop Code Example java reverse loop Code Example
java android edit text set value Code Example java android edit text set value Code Example
Jframe in middle of screen java Code Example Jframe in middle of screen java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9