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!

Converting Array to ArrayList not working

706771Oct 11 2010 — edited Oct 11 2010
Dear Members :

Following line fails to convert my array to arraylist:

List myArrayList = Arrays.asList(myArray);

bcoz when I do

System.out.println("ArrayList: "+myArrayList);

it returns [[I@3e25a5]. The array is just a standard array: int[] myArray.
I even tried with: List myArrayList = new ArrayList(Arrays.asList(myArray)); but same.

Could you please suggest a solution to this ?

Thanks in advance.
Atanu
This post has been answered by darrylburke on Oct 11 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2010
Added on Oct 11 2010
7 comments
213 views