Can we add Object as a key in HashMap? If yes then how?
Anonymous
Yes, But Class of the key Object must override both hashCode () and equals() methods. Custom class should follow the contract between hashCode() and equals().
Check out your Company Bowl for anonymous work chats.