programming languages Online Quiz - 319
Casual Mode - Take your time!
1 / 20
Correct
0
Incorrect
0
Score
0%
Multiple Answers
Given: 11. public class Key { 12. private long id1; 13. private long 1d2; 14. 15. // class Key methods 16. } A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works correctly as a key? (Choose two.)
- public int hashCode()
- public boolean equals(Key k)
- public int compareTo(Object o)
- public boolean equals(Object o)
- public boolean compareTo(Key k)