Surprisingly, it seems there was no simple, one-liner kind of solution in java to sort int array in descending order before java 8. For example, check this post. Now that we have java 8, is there an elegant, simple, one-liner way using java 8 features, such as stream and lambda expression, to sort an int array in descending order?
Edit
I am interested in a solution for int[]
, not Integer[]
.
Edit
I am interested in a solution that only uses JAVA SE library.