The map size

Report a typo

Input the map size for the case below.

Note that it doesn't matter if hashCode() or equals() are overridden or not. You will get the same result.

    Person james = new Person("James Gosling");
    Person person = james;

    Map<Person, Integer> map = new HashMap();
    map.put(james, 1995);
    map.put(person, 1995);
        
    System.out.println(map.size());
Enter a number
___

Create a free account to access the full topic