Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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.
jQuery in Action, 3rd edition
subject: Problem with Sort Method
It's not a secret anymore!