HOW TO SYNCHRONIZE LIST, SET AND MAP ELEMENTS?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
 669  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    How to synchronize List, Set and Map elements?

    Yes, Collections class provides methods to make List, Set or Map elements as synchronized:

    public static List synchronizedList(List l){}
    public static Set synchronizedSet(Set s){}
    public static SortedSet synchronizedSortedSet(SortedSet s){}
    public static Map synchronizedMap(Map m){}
    public static SortedMap synchronizedSortedMap(SortedMap m){}

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!