Home > DeveloperSection > Interviews > How to synchronize List, Set and Map elements?

Posted on    May-13-2015 11:26 PM

 Java Java  Collection 
Ratings:
 1 Answer(s)
  402  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    May-13-2015 11:26 PM

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){}

Don't want to miss updates? Please click the below button!

Follow MindStick