posted 17 years ago
Hi Ali,
asList() method of ArrayList returns fixed sized ArrayList.
And this ArrayList is not the List that implements List interface,
but sub class of Arrays class.
Try this:
You will get the output as:
java.util.Arrays$ArrayList
and prove your answer with this code:
Arrays.ArrayList extends AbstractList class that implement List
interface.
What operation is supported in that are:
get() and set()
remove() and add() throws UnsupportedOperationException, because these
operations are not supported by it.
And yeah, one more thing; if you use the set() method on the list it
will reflect the array also and vice versa;
Check it out!!!
Regards,
cmbhatt
[ April 23, 2007: Message edited by: Chandra Bhatt ]