![]() |
VOOZH | about |
In this article we will discuss about unmodifiableNavigableSet() method.
This method is available in NavigableSet. It is an data structure that can store elements in an order. For this we have to use tree set.
we can create a treeset by using the following syntax:
NavigableSet<datatype> data = new TreeSet<String>();
where,
This method will return the unmodifiable view of the given Navigable set.
Syntax:
public static <T> NavigableSet<T> unmodifiableSortedSet(SortedSet<T> data)
where, data is the Navigable set which is returned in an unmodifiable view.
Example1 :
Output:
[1, 2, 3, 34] [1, 2, 3, 32, 34]
Example 2
Output:
[Python, R, java, sql] [Python, R, bigdata/iot, java, sql]