Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 [ 7 0 POINTS ] A . Create a public Java class named City that contains the following: [ 1 Points ] Three
Question
POINTS
A Create a public Java class named City that contains the following:
Points Three private instance variables: cityName of type String, populationNumber of type Long and cityArea of type Double.
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:
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.
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started