Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how we sort arraylist contents

 
rakesh repala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me how we sort arraylist elements
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rakesh,

you can use the java.util.Collections helper class. There's a sort() method which takes a collection like ArrayList as input!

Marco
 
bart zagers
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you already try a search? This is a topic that comes up from time to time.
When you search this "Java in General (beginner)" forum with "sort list".
This is the first result, which contains a recent discussion on sorting a list (although the title wrongly says "sort array").
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic