Meaningless Drivel is fun!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Arrays asList() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Arrays asList() method" Watch "Arrays asList() method" New topic

Arrays asList() method

Saibabaa Pragada
Ranch Hand

Joined: Oct 24, 2010
Posts: 162
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2410
Not exactly sure what is going on but Lists are only for Objects. Not sure what happens when you try to use a primitive array.

Try the following and it works as you expect:

Edit: it looks like it just returns the original array:

Subhasis Gorai

Joined: Dec 13, 2010
Posts: 3
Please check this topic, hope it helps ..
I agree. Here's the link:
subject: Arrays asList() method
It's not a secret anymore!