Home  >  Forum  >  Core Java
Post New Query

java.lang.UnsupportedOperationException


joined on
May 23,2013
Asked on May 26,2013
Hi friends, I am adding element in the list returned by Collections.nCopies and got below error.
Any clue?

Exception in thread "main" java.lang.UnsupportedOperationException
at java.util.AbstractList.add(Unknown Source)
at java.util.AbstractList.add(Unknown Source)
joined on
May 11,2013
Replied on May 26,2013

The List in which you are adding the content are immutable. The list are immutable if  returned by
Collections.nCopies and Collections.emptyList 

Write Answer









Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us