We can
create a read-only collection using
Collections.unmodifiableCollection(Collection
c) method before
passing it as argument, this will make sure that any operation to change the
collection will throw UnsupportedOperationException
No comments:
Post a Comment