tag:blogger.com,1999:blog-694855878384792308.post1433593014438001636..comments2024-03-21T06:26:49.387-07:00Comments on Java67: How to sort ArrayList in Java? Examplesjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-694855878384792308.post-38165382662390897042017-09-13T22:04:26.848-07:002017-09-13T22:04:26.848-07:00Simple Collections.reverse(unsortedList) after the...Simple Collections.reverse(unsortedList) after the first sort will sort it as per descendingAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-16570098712786839532014-11-29T07:25:24.459-08:002014-11-29T07:25:24.459-08:00This is indeed a good example to sort an ArrayList...This is indeed a good example to sort an ArrayList of String alphabetically, but this will also work in case of Integer, Date, or any other value type? I believe since it is using Comparable it will sort in the order defined there, as String Comparable sorts data alphabetically but Integer will be in increasing order and Date may be in chronological order. Correct me if I am wrong. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-77606045324897465202013-07-15T01:14:02.222-07:002013-07-15T01:14:02.222-07:00I have a List of Integers and a List of String, Ho...I have a List of Integers and a List of String, How can I sort them according to there natural order e.g. Sorting Integer List with numeric ascending order and Sorting String List with alphabetic order?Anonymousnoreply@blogger.com