File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes printing numbers???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "printing numbers????" Watch "printing numbers????" New topic

printing numbers????

raymond yadao
Ranch Hand

Joined: Jan 29, 2001
Posts: 88
is there an easy way to program a program that accept 10 numbers and prints it from highest to lowest using the collection classes?
i know treeset has a sorting mechanism that prints its elements from lowest to highest...
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Yes there is an easy way to do this. You might take advantage of one of the Collections.sort() methods or one of the Arrays.sort() methods. Take a look at The Java 2 API Documentation to figure out what might work best for your problem.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Don't get me started about those stupid light bulbs.
subject: printing numbers????
Similar Threads
help anda what is the package for the sort()
Help with sorting numbers
JavaMail: set the priority of email
Java Grading System