InterviewSolution
Saved Bookmarks
| 1. |
What Is The Output Of This Program? 1. Import Java.util.*; 2. Class Maps { 3. Public Static Void Main(string Args[]) { 4. Hashmap Obj = New Hashmap(); 5. Obj.put("a", New Integer(1)); 6. Obj.put("b", New Integer(2)); 7. Obj.put("c", New Integer(3)); 8. System.out.println(obj.get("b")); 9. } 10. } |
|
Answer» obj.get(“B”) METHOD is used to obtain the VALUE associated with KEY “B”, which is 2. Output: $ JAVAC Maps.java obj.get(“B”) method is used to obtain the value associated with key “B”, which is 2. Output: $ javac Maps.java |
|