0

How to sort an array in Java?

17th Aug 2016, 9:56 AM
Shamim Ali
Shamim Ali - avatar
3 Respuestas
+ 2
Arrays.sort(*your Array*);
17th Aug 2016, 10:10 AM
FreakManMega
+ 2
It's the fastest way...but if you want to sort an array of an object, written by yourself, you have to implement the interface Comparable and you also have to override the method "compareTo". For more details take a look at https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html
17th Aug 2016, 10:25 AM
FreakManMega
0
@freakmanmega is it the fastest way or we can use quick sort algorithm
17th Aug 2016, 10:11 AM
Shamim Ali
Shamim Ali - avatar