Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Printing an Array

807598Oct 1 2006 — edited Oct 1 2006
Hello,

I need to print an ArrayList in lexical order. This is what I've done so far.....

I made my ArrayList into an Array..
I sorted my new Array
Then I tried printing the Array out and I'm getting the reference rather than the values..

I think I'm missing something small, could any give me an idea??

Object[] arrs = aList.toArray();
Arrays.sort(arrs);
System.out.println("Arrs: " + arrs.toString());

Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2006
Added on Oct 1 2006
4 comments
225 views