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.
The moose likes Beginning Java and the fly likes Problem with Sort Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with Sort Method" Watch "Problem with Sort Method" New topic

Problem with Sort Method

Nick Hallloran

Joined: Feb 09, 2010
Posts: 19
I need to sort three numbers in ascending order. The first two are properly done but the third number that is entered always shows up as the first number...just wondering where i am going wrong

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Be careful not to fall from your chair when looking at the following part :

[My Blog]
All roads lead to JavaRanch
Nick Hallloran

Joined: Feb 09, 2010
Posts: 19
haha wow! I cant believe i missed that...yea it definitely hurt falling out of my chair
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
Error is in lines 78/79 - your output is: third + second + third.
I agree. Here's the link:
subject: Problem with Sort Method
It's not a secret anymore!