Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions