Wipro TalentNext PBL
Topics Covered Hands-on Assignments for Map
No. Hands-on Assignment Topics Covered Status
1
-
Develop a java class with a instance variable CountryMap HashMap (M1) add a method saveCountryCapital(String CountryName, String capital) , the method should add the passed country and capital as key/value in the map M1 and return the Map (M1). Key- Country Value - Capital India Delhi Japan Tokyo
-
Develop a method getCapital(String CountryName) which returns the capital for the country passed from the Map M1 created in step 1.
-
Develop a method getCountry(String capitalName) which returns the country for the capital name passed from the Map M1 created in step 1.
-
Develop a method which iterates through the map M1 and creates another map M2 with Capital as the key and value as Country and returns the Map M2. Key – Capital Value – Country Delhi India Tokyo Japan
-
Develop a method which iterates through the map M1 and creates an ArrayList with all the Country names stored as keys. This method should return the ArrayList. NOTE: You can test the methods using a main method.
Map HashMap
2
Create a Collection called HashMap which is capable of storing String objects. The program should have the following abilities a) Check if a particular key exists or not b) Check if a particular value exists or not c) Use Iterator to loop through the map key set
Map HashMap
3
Write a program that will have a Properties class which is capable of storing some States of India and their Capital. Use an Iterator to list all the elements of the Properties.
Map HashTable Properties
4
Create a Collection “ContactList” using HashMap to store name and phone number of contacts added. The program should use appropriate generics (String, Integer) and have the following abilities: a) Check if a particular key exists or not b) Check if a particular value exists or not c) Use Iterator to loop through the map key set
Map HashMap
5
Implement the assignment 1 using TreeMap
Map TreeMap
6
Implement the assignment 1 using HashTable
Map HashTable