top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to synchronize List, Set and Map elements in java?

0 votes
769 views
How to synchronize List, Set and Map elements in java?
posted Feb 5, 2018 by Ammy Jack

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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 Feb 9, 2018 by Frank Lee
...