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 sorting an array... 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 sorting an array..." Watch "problem with sorting an array..." New topic

problem with sorting an array...

Brandi Love
Ranch Hand

Joined: Sep 19, 2003
Posts: 133
This program is supposed to take values from a 4 by 5 array and put them into a one dimensional array. It is then supposed to sort the one dimensional array, and print the individual values. I've got the program so that it creates the one dimension array, but after I added Arrays.sort I get this at the command line when I try to run it:

Heres my code:

Anyone have any idea whats going on here and as to how I might fix my code so it works?
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
Are you sure this line is correct:

That's not the array you want sorted, is it?
Brandi Love
Ranch Hand

Joined: Sep 19, 2003
Posts: 133
*smacks self on forehead*
I agree. Here's the link:
subject: problem with sorting an array...
It's not a secret anymore!