This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with sorting an array...

 
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*
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic