Coding Output

Report a typo

What is the output of this code?

import java.util.HashMap;

public class SampleCode {
    public static void main(String[] args) {
        HashMap<String, Integer> myMap = new HashMap<>();
        myMap.put("apple", 5);
        myMap.put("banana", 3);
        myMap.put("cherry", 10);
        myMap.put("apple", 7);
        myMap.put("orange", null);
        System.out.println(myMap.get("apple"));
    }
}
Enter a number
___

Create a free account to access the full topic