+ 1
Write some java array code that can clear my concept
Java array programs
8 Answers
+ 2
You should share where you are having problems. https://www.sololearn.com/learn/Java/2148/
+ 2
AlphaOne he can add Collections.reverseOrder()
Like Arrays.sort(array, Collections.reverseOrder());
+ 2
I never knew that. thanks for the info Michal.
+ 2
this is an implementation of what master Michal mentioned.
take note that this only works on objects and not primitive types like int. you need to convert each primitive type to their respective object counterpart. (e.g. Integer for int, Double for double, Boolean for boolean, etc.)
https://code.sololearn.com/c8ozt72h4EpZ/?ref=app
+ 2
Exactly, you can do just like AlphaOne mentioned. Just some complete from me.
https://code.sololearn.com/cd1B24Q01IfP/?ref=app
+ 1
Basit Mir do you have to implement your method? If you can use something already done you can use "Arrays"
+ 1
Basit Mir there is a built-in sort method in Arrays.
Arrays.sort(yourArray)
it only sorts in ascending order. if you need to create your own algorithm, then read up on sorting algorithms here at SoloLearn
0
I have to create a program ascending and descending order using java array