Home  >  Forum  >  Core Java
Post New Query

java.lang.UnsupportedOperationException at java.util.AbstractList.add

Asked on May 16, 2013
Hi Friends,

I am using Arrays.asList and in returned list I am adding data by
list.add and got the below error.

Exception in thread "main" java.lang.
at java.util.AbstractList.add(Unknown Source)
at java.util.AbstractList.add(Unknown Source)
at com.util.AsListDemo.main(AsListDemo.java:13)

Replied on May 16, 2013
List obtained by Arrays.asList is of fixed length. We cannot add
element by add method.

Write Answer

©2022 concretepage.com | Privacy Policy | Contact Us