The Artima Developer Community
Sponsored Link

Java Buzz Forum
Using Collections To Sort And Shuffle A List

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Goldy Lukka

Posts: 1008
Nickname: xyling
Registered: Jan, 2004

Goldy Lukka is a Java Developer and an Entrepreneur. He is Founder of xyling.com.
Using Collections To Sort And Shuffle A List Posted: Jul 18, 2004 11:23 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Goldy Lukka.
Original Post: Using Collections To Sort And Shuffle A List
Feed Title: Xyling Java Blogs
Feed URL: http://www.javablogs.xyling.com/thisWeek.rss
Feed Description: Your one stop source for Java Related Resources.
Latest Java Buzz Posts
Latest Java Buzz Posts by Goldy Lukka
Latest Posts From Xyling Java Blogs

Advertisement
The class java.util.Collections contains many methods designed to operate on objects that implement the List interface. This utility class includes methods to perform a binary search on a list for a specified object, to copy the elements of one list into another, and to swap elements at specified positions in a list. In this tip, you will investigate two simple methods in the Collections class: shuffle() and rotate(). Then you'll use another Collections method, sort(), to sort items in a list. To sort there must be some way to compare objects. In this tip, you will sort using Comparable and later a Comparator.

[Resource-Type: Tip; Category: Java/J2SE; XRating: 4]

Read: Using Collections To Sort And Shuffle A List

Topic: Scrolling on Demand Previous Topic   Next Topic Topic: Java Web Start: Close but no cigar?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use