Question: please solve in java programming language (data structures) Q1 : - Write a class called Cities with the following details : - Attributes: City_No (int),

please solve in java programming language (data structures)
please solve in java programming language (data structures) Q1 : - Write

Q1 : - Write a class called Cities with the following details : - Attributes: City_No (int), City_Name (String), Province (String) Overloaded constructor Ex: Cities (City_No, City_Name, Province) - toString() method to return Cities details (City_No, City_Name, Province) - Write TesthashSet class with main and perform the following operation: - Create 6 Cities objects - Create a HashSet of Cities - Add 6 Cities object to the HashSet. - Print size of HashSet. - Remove a City from HashSet Check if a given City is available in the HashSet or not - Remove another City from HashSet - Print the HashSet using for...in loop - Print the HashSet using Iterator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!