Find a map size

Report a typo

How many elements will the map from the sample below have?

public class IdentityHashMapDemo {
    public static void main(String[] args) {
        Person james = new Person("James Gosling", 1955);
        Person guido = new Person("Guido van Rossum", 1956);

        Map<Person, String> map = new IdentityHashMap<>();
        map.put(james, "Java");
        map.put(new Person("James Gosling", 1955), "Java");
        map.put(guido, "Python");
    }
}
Enter a number
___

Create a free account to access the full topic