Complete the code to create a HashMap that stores student names as keys and their scores as values.
HashMap<String, Integer> scores = new HashMap<>(); scores.[1]("Alice", 90);
The put method adds a key-value pair to the HashMap.
Complete the code to retrieve the score of a student named "Bob" from the HashMap.
Integer bobScore = scores.[1]("Bob");
The get method retrieves the value associated with the given key in a HashMap.
Fix the error in the code to check if the key "Charlie" exists in the HashMap.
boolean hasCharlie = scores.[1]("Charlie");
The correct method to check if a key exists in a HashMap is containsKey.
Fill both blanks to create a HashMap and add a key-value pair for "David" with score 85.
HashMap<String, Integer> [1] = new [2]<>(); [1].put("David", 85);
The variable name is scores and the object type is HashMap.
Fill all three blanks to create a HashMap, add a key-value pair, and check if the key "Eve" exists.
HashMap<String, Integer> [1] = new [2]<>(); [1].put("Eve", 95); boolean exists = [1].[3]("Eve");
The variable name is studentScores, the object type is HashMap, and the method to check key existence is containsKey.
