Q. How are you able to sort given HashMap on basis of values

  • (A) Implement Comparator interface and override its compare method
  • (B) It is not possible
  • (C) Implement Comparator interface and override its compareTo method
  • (D) Implement Comparator and Comparable interface
πŸ’¬ Discuss
βœ… Correct Answer: (A) Implement Comparator interface and override its compare method

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
201
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Uday Singh
Publisher
πŸ“ˆ
87%
Success Rate