6 1collections-Task1
6 1collections-Task1
Make sure that no duplicate Students are getting added into the Collection.
Student Class will encapsulate age, firstname, lastname and adderess
Data type of address is Address.java There is HAS-A relationship between Student and
Address.
If 2 Students are having same FULLNAME and same Address then only consider those
2 Students as Equal, otherwise not.
2. Write a class CityStateMap by using child class of java.util.Collection. This mapping class
will allow the user to add new city-state pair in to it. User can get the state of the city by
calling get method on this class. Duplicate city entries are not allowed, in such case
previous mapping should be replaced with new one. Assume that there is a text file
having city state values (in string). Read this file and store these values using
CityStateMap class. Let user do the following operations with this class: