Modify values of z Number
z . first = Integer . parseInt ( String . valueOf ( curr . getValue ( ) ) ) ; z . second = Integer . parseInt ( String . valueOf ( curr . getKey ( ) ) ) ; } } System . out . print ( " Three ▁ largest ▁ elements ▁ are ▁ " + x . second + " ▁ " + y . second + " ▁ " + z . second ) ; }