Returns an empty set (immutable). This set is serializable. Unlike the like-named field, this method is parameterized.
This example illustrates the type-safe way to obtain an empty set:
Set<String> s = Collections.emptySet();
<T> | the class of the objects in the set |
EMPTY_SET
@implNote Implementations of this method need not create a separate
Set
object for each call. Using this method is likely to have
comparable cost to using the like-named field. (Unlike this method, the
field does not provide type safety.)
Diagram: Collections