That's briliant but from my point of view this loooks easier: String numeroMaximo = Arrays.stream(Long.toString(number).split("")) .sorted((a, b) -> b.compareTo(a)) .collect(Collectors.joining());
Loading collection data...
That's briliant but from my point of view this loooks easier:
String numeroMaximo = Arrays.stream(Long.toString(number).split(""))
.sorted((a, b) -> b.compareTo(a))
.collect(Collectors.joining());