I want to override String classes Hashcode / Equals methods as I know the String class is final and the method inside that can not be overridden. I have a scenario where I want to apply the same. for instance code is given below,
public static void main(String[] args) {
Map<String,Integer> map = new HashMap();
map.put("Mukul", 1);
map.put("Aditya", 1);
System.out.println(map);
}
As I am passing string as a key and map is gonna call String classes hashcode method implicitly. Now I want to declare that the given keys are same in my way. Please suggest if there is any way to do so?