Getting an element with two objects

Report a typo

What will the following code print?

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

        Map<Person, String> map = new IdentityHashMap<>();
        map.put(james, "Java");
        map.put(guido, "Python");
        map.put(person, "???");

        System.out.println(map.get(james));
    }
}
Enter a short text
___

Create a free account to access the full topic