Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What is the difference between descendingKeySet() and descendingMap() methods of NavigableMap?

Pragya Keshap answered on February 4, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


What is the difference between descendingKeySet() and descendingMap() methods of NavigableMap?

0

The descendingKeySet() method of NavigableMap returns a

NavigableSet in which the elements are stored in reversed order as

compared to the original key set.

The returned view is internally represented by the original KeySet

of NavigableMap. Therefore any changes to the descending set also

get reflected in the original set.

But it is not recommended to remove elements directly from the key

set. We should use the Map.remove() method.

The descendingMap() method of NavigableMap returns a

NavigableMap which is an inverse view of the original Map. The

order of the elements in this view are in reverse order of the

elements in original map. Any changes to this view are also

reflected in the original map.

https://www.geeksforgeeks.org/java-util-treemap-descendingmap-descendingkeyset-java/

Popularity 1/10 Helpfulness 1/10 Language java
Source: Grepper
Link to this answer
Share Copy Link
Contributed on Feb 04 2023
Pragya Keshap
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.