my dog learned polymorphism
The moose likes Beginning Java and the fly likes Printing a sorted array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Printing a sorted array" Watch "Printing a sorted array" New topic

Printing a sorted array

James Palmer
Ranch Hand

Joined: Mar 15, 2004
Posts: 36
Hello, i have an array with 3 items in it and i want to print them in ascending order in a toString method.My code is:
public String toString() {
return "{" + (pile) + "}";
What do i need to change to this to get it working.Thanks
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Try this
I agree. Here's the link:
subject: Printing a sorted array
It's not a secret anymore!