Mutated keys

Report a typo

What is the size of the map from the sample below?

public class IdentityHashMapDemo {
    public static void main(String[] args) {
        Person james = new Person("James Gosling", 1955);
        Person person = james;
        person.setName("J. Gosling");

        Map<Person, String> map = new IdentityHashMap<>();
        map.put(james, "Java");
        map.put(person, "Sun Microsystems");
    }
}
Enter a number
___

Create a free account to access the full topic