Results 1 to 4 of 4
Thread: sorting objects in java
- 01-07-2011, 06:45 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 85
- Rep Power
- 0
- 01-07-2011, 06:52 PM #2
What have you tried? How are the Objects stored? In a List? In an array? As separate variables?
You could write a sorting method yourself. Or you could implement Comparable. Or you could set up a Comparator. Google and the API are your friends.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 01-07-2011, 07:36 PM #3
Senior Member
- Join Date
- Dec 2010
- Posts
- 100
- Rep Power
- 0
I agree with Kevin. You should read up on how to implement the Comparable interface in your class. Please see link to API for Comparable: Comparable (Java 2 Platform SE v1.4.2)
Best,--user0--
- 01-08-2011, 09:18 AM #4
Member
- Join Date
- Sep 2008
- Posts
- 85
- Rep Power
- 0
Similar Threads
-
Sorting a deck of card objects by either suite or rank
By coyne20 in forum New To JavaReplies: 2Last Post: 12-13-2010, 11:12 AM -
Java - Comparator, sorting arrayLists
By Kerrai in forum New To JavaReplies: 15Last Post: 10-24-2010, 09:41 PM -
Sorting objects with 2 strings arguments and 2 int arguments
By tirwit in forum New To JavaReplies: 8Last Post: 09-23-2010, 12:07 AM -
Sorting/Searching Objects with multiple types.
By gcampton in forum New To JavaReplies: 20Last Post: 10-21-2009, 11:58 PM -
Sorting strings in java?
By alexander.s in forum New To JavaReplies: 10Last Post: 09-01-2008, 04:14 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks