• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coverting Array to List when i have a int[] array  RSS feed

 
Yeray Santana Borges
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a problem whe use the Arrays.asList(an_array). If i have a array of primitives int, What type of List is returned whit the Arrays.asList(my_primitive_type_array) ?

Please, sorry for my poor english, i will try to explain me with an example code:



what code must i to insert in ** for get all the values of the iList variable and print it??

this code dont compile and i dnt nkow why:
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not too sure... but I don't think this...



does what you want. The method takes an array of objects. And since you are not passing it an array of objects, the varargs should make it a single parameter of one int array. (one object)

If you check the size of the returned list, I am willing to bet it is one -- with one entry -- the original int array.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!