Sort Arraylist Integers

C

csgraham74

Hi Guys,

Just wondering if someone could help me with an arraylist issue.

I have an array of integers

Arraylist
4 , 2, 11, 2, 21, 3 ,15 , 30

i want the arraylist to now be sorted according to the values either
ascending or descending.

at present it appears that the arraylist.sort() method sorts these
values as text ie. 11,13,2,2,3,30 etc...

can anyone help

thanks

CG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top