This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
We don't like to help folks with homework assignments here. But, I will tell you that a simple Google search for "sort java" will get you started on the right track. You'll have to figure it out from there.
James Carman, President<br />Carman Consulting, Inc.
Joined: Feb 11, 2005
Originally posted by James Carman: We don't like to help folks with homework assignments here. But, I will tell you that a simple Google search for "sort java" will get you started on the right track. You'll have to figure it out from there.
its not that i asked to do the whole program anyway thanks for tip.
Joined: Feb 20, 2001
Which part were you having more trouble with? The sorting or the printing?
Originally posted by Garry Meax: sorting. so, can you help me?
Absolutely! The following code will sort three integers:It's not optimized, and of course it probably won't work for four integers. But hey, it sorts!
If this isn't what you need, please elaborate on your precise needs, what classes and packages you've looked in for ideas, what you've tried to do so far, how it turned out (compile errors, nothing happened, incorrect output), etc. Without that information, you get code that sorts three integers.
Skipping ahead . . . check out java.util.Comparable and java.util.Comparator and the java.util.Collection classes. Try it out, then ask specific questions so we can help you, most likely with more hints (and probably a few more jokes, but there's gotta be a price, right?).