This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Arrays asList() method" Watch "Arrays asList() method" New topic
Author

Arrays asList() method

Saibabaa Pragada
Ranch Hand

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

Joined: Jun 13, 2009
Posts: 2180
    
    7
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
Greenhorn

Joined: Dec 13, 2010
Posts: 3
Please check this topic, hope it helps ..
http://www.coderanch.com/t/510492/java-programmer-SCJP/certification/Arrays-asList
 
Don't get me started about those stupid light bulbs.
 
subject: Arrays asList() method