//Create a Java program to store the Name and Salary of employees //Name = [‘Ram’,’Rahim’,’Sid’,’Tom’] //Salary = [30000,20000,35000,23000] // //1. Add a new employee to the dictionary with name as ‘Shankar’ and salary as 15000 //2. Update the salary of tom to 25000 //3. List the names of employees who earn more than 20000 package InterViewQuestions; import java.util.HashMap; import java.util.Map; public class TestClassSunMicrosystem { public static void main(String[] args) { HashMap<String, Integer> map = new HashMap<String, Integer>(); map.put("Ram", 30000); map.put("Ratan", 20000); map.put("Sid", 35000); map.put("Tom", 23000); map.put("Shander", 25000); //update the salary and print more then 20k salary users for (Map.Entry entry : map.entrySet()) { map.replace("Tom", 25000); String str = entry.getValue().toString(); int salary = Integer.parseInt(str); //System.out.println("The Value is : "+salary); if (salary > 20000) { System.out.println(entry.getKey() + " " + entry.getValue()); } } } }