Let's create a virtual janitorial business with a cleanAllApartments method for all apartment types and individual methods for cleaning one-, two- and three-bedroom apartments.
Janitorial services
- 8
Locked
Comments (7)
- Popular
- New
- Old
You must be signed in to leave a comment
Andrew Evans
1 March 2022, 01:37
Unknown Error! Nice!
0
Justin Smith
13 August 2021, 18:56
This was easier than some of the green easy ones, IMO.
0
Roman Grygorczuk
4 April 2021, 11:15
This is absolutely unclear to me.
+1
Samuel MichaelExpert
20 February 2021, 23:13
Why do you need to cast the apartment objects to room type if there is already an "if instanceof" apartment type statement?
0
ImDevin
10 June 2021, 19:40
i believe instanceof just checks the status of the object. you still need to cast down to the OneRoomApt to access its methods.
+1
Amo programmareExpert
13 February, 10:57
I guess my confusion arised because of the shorthand used to create the object. If I understood correctly, the object was created as an Apartment object because the ArrayList accepts Apartment objects. Is that correct?
0
Zoltán R
12 July 2019, 17:20
whats wrong with my code?
0