1.

How To Make A Collection Read Only?

Answer»

USE following methods:

  • Collections.unmodifiableList(list);
  • Collections.unmodifiableSet(SET);
  • Collections.unmodifiableMap(map);

These methods TAKES collection parameter and RETURN a new read-only collection with same elements as in original collection.

Use following methods:

These methods takes collection parameter and return a new read-only collection with same elements as in original collection.



Discussion

No Comment Found