Collections.emptySortedSet() in Java

Collections.emptySortedSet(): This method is available in java.util.Collections class of Java.

Syntax:

<Object> SortedSet<Object> java.util.Collections.emptySortedSet()

This method returns an empty sorted set.

Note: This set is serializable.

Parameters: NA

Returns: the empty sorted set.

Exceptions: NA

Approach

Java

import java.util.Collections;

public class CollectionsemptySortedSet {
    public static void main(String[] args) {

        System.out.println(Collections.emptySortedSet());

    }
}

Output:

[]


No comments:

Post a Comment