Need Help Sorting Map in Descending order by values in JAVA

  Kiến thức lập trình

I have tried multiple examples on how to sort in descending order by values and none have worked for me. Can someone please advise where I am making a mistake.

This is my basic Map called vMap and the key and values content in the console:
enter image description here

The Keys are the big cap letters and the Values are the numbers and the way that currently prints on the console is like this:

enter image description here

I tried this to print the Values in reverse order by comparing the Keys, but did not get it:
enter image description here

I tried by Values but also did not work:
enter image description here

Does anyone know what I am doing wrong?

LEAVE A COMMENT