Getting an element

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 person = james;
        james = null;

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

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

Create a free account to access the full topic