Question: Question 1 A . Create a public Java class named City that contains the following: [ 1 Points ] Three private instance variables: cityName of

Question 1
A. Create a public Java class named City that contains the following:
[1 Points] Three private instance variables: cityName of type String, populationNumber of type Long and cityArea of type Double.
[4 Points] Public instance methods including constructor; setters; getters; and any other methods required for the class to accomplish the next task.
B. Create a Demo class to accomplish the following requirements:
[2 Points] Create four objects of type city and add them to a cityList of type ArraySortedList the objects should be sorted based on number of populations.
[3 Points] Define a static method named joinCityListsBasedArea, which takes three parameters: two parameters represent two cityLists of type ArraySortedList. And one parameter represents the Area criterion to join the two lists. This method is intended to join the two city lists in a one list that contains the cities with area greater than or equal to received area. However, the cityList should be kept sorted after applying the method.
 Question 1 A. Create a public Java class named City that

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!