This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is the List class 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 "What is the List class" Watch "What is the List class" New topic
Author

What is the List class

Vidhya Ramaswamy
Ranch Hand

Joined: Oct 10, 2007
Posts: 65
As we know, List is an interface. So, which class does Arrays.asList() return exactly?

Rajasekar Elango
Ranch Hand

Joined: Sep 13, 2004
Posts: 105
This blog might help you..

- Rajasekar
[ December 10, 2007: Message edited by: Rajasekar Elango ]

SCJP 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

It doesn't matter. All you know is that whatever the class is, it implements the List interface.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vidhya Ramaswamy
Ranch Hand

Joined: Oct 10, 2007
Posts: 65
Thanks Rajasekar, that was helpful.

No wonder, the changes(using set()) made to the List view that is returned from Arrays.asList() is reflected in the original array.

But, if a new ArrayList object if created from Arrays.asList() :

and changes are made to this(using set()), it is not reflected in the original array.
 
Have you checked out Aspose?
 
subject: What is the List class
 
It's not a secret anymore!