| Author |
Generic
|
meeta gaur
Ranch Hand
Joined: Dec 05, 2012
Posts: 225
|
|
Synchronization Wrappers
The synchronization wrappers add automatic synchronization (thread-safety) to an arbitrary collection. Each of the six core collection interfaces — Collection, Set, List, Map, SortedSet, and SortedMap — has one static factory method.
public static <T> Collection<T> synchronizedCollection(Collection<T> c);
public static <T> Set<T> synchronizedSet(Set<T> s);
public static <T> List<T> synchronizedList(List<T> list);
public static <K,V> Map<K,V> synchronizedMap(Map<K,V> m);
public static <T> SortedSet<T> synchronizedSortedSet( SortedSet<T> s);
public static <K,V> SortedMap<K,V> synchronizedSortedMap( SortedMap<K,V> m);
I'm not getting these <T>.....<T> two times thing, what is this ?
|
OCAJP
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12913
|
|
|
These are methods with type parameters. The first <T> is to indicate that the method has a type parameter named T, and the subsequent <T>s are places where the type parameter is used.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Generic
|
|
|