Question: 1. Create a class named Apartment with the following Data fields: ID, Address and price, of type int, String and double implement: - Constructors

1. Create a class named Apartment with the following Data fields: ID, Address and price, of type int, String and double implement: - Constructors - Getters and setters 2. In testing class (that contains main method) a. In main method create an array list of the following apartment objects: ID: 40, Address: 10 Dufferin street, price:1000 ID: 41, Address: 40 Bloor street, price:1500 ID: 42, Address: 30 Kennedy street, price:900 ID: 43, Address: 60 Kennedy street, price:950 b. Implement a method named getCheapestAppartment with a list of apartment objects as argument. This method should: Finds and return the cheapest apartment in the list. c. In main method call getCheapestAppartment method, then display the address and price of the cheapest apartment.
Step by Step Solution
3.45 Rating (165 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
