![]() |
VOOZH | about |
The unmodifiableSortedSet() method of Java Collections is available in TreeSet. A Tree Set is a data structure that can store elements in order.
Syntax:
SortedSet<datatype> data = new TreeSet<String>();
where,
The unmodifiableSortedSet() method of the Java Collections class is used to get an unmodifiable view of the specified sorted set.
Syntax:
public static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> data)
where data is the sorted set that is returned in an unmodifiable view.
Return type: This method returns an unmodifiable view of the specified Sorted Set.
Example 1:
Demonstration before and after modification
[Python, R, java, sql] [Python, R, bigdata/iot, java, sql]
Example 2:
[1, 2, 3, 34] [1, 2, 3, 32, 34]