This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.



Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with sorting an array...  RSS feed

 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure this line is correct:

That's not the array you want sorted, is it?
 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*smacks self on forehead*
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!