Thursday, 22 August 2013

How to add elements in List when used Arrays.asList()

How to add elements in List when used Arrays.asList()

We cannot perform <Collection>.add or <Collection>.addAll operation on
collections we have obtained from Arrays.asList .. only remove operation
is permitted.
So What if I come across a scenario where I require to add new Element in
List without deleting previous elements in List?. How can I achieve this?

No comments:

Post a Comment