Friday 10 June 2011

How can a method return an immutable (read-only) collection (list,map,set)?






return Collections.unmodifiableList(list);

return Collections.unmodifiableMap(map);

No comments:

Post a Comment