aspose file tools
The moose likes Java in General and the fly likes collections.remove() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "collections.remove()" Watch "collections.remove()" New topic
Author

collections.remove()

Amirtharaj Chinnaraj
Ranch Hand

Joined: Sep 28, 2006
Posts: 215
hi guys
i tried this code below



but i end up in exception below



i dont know the reason
looking for yopur replies
amir
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
It is optional for a class that implements the Collection interface to allow objects to be the removed. If it doesn't want to allow objects to be removed, then it's implementation of the remove method should just throw an UnsupportedOperationException. Obviously the object that Arrays.asList returns has chosen to do this.
[ April 24, 2008: Message edited by: Joanne Neal ]

Joanne
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
Arrays.asList(s) returns unmodifiable collection. Therefore you need to use other collection:



Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: collections.remove()
 
Similar Threads
Getting error while serializing. Please see the following code while produces IOException.
Facing problem in Junit4 and spring 2.5 configuration
how to post jobs in Monster using their webservice
Error While running Java Program
Issues with cmd java command