Let's categorize cars. Create classes for affordable and expensive cars, and then make the Ferrari and GeoMetro classes inherit them as you see fit (but please note that the CodeGym code validator has a definite opinion on the matter). We'll implement printlnDesire methods in these classes that will tell us the secret desires of their drivers.
OOP: Cars
- 8
Locked
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Samuel MichaelExpert
26 February 2021, 02:50
Can anyone explain what the point of this exercise is? Why do the descendant classes have to have wider accessibility relative to the parent class?
+2
Guadalupe Gagnon
30 October 2021, 01:36
"visibility is expanded" does not equal "visibility is wider than"
0
Devonte A
7 July 2020, 08:13
I would have thought that the public access modifier has the widest scope?
+1
Samuel MichaelExpert
26 February 2021, 02:50
I think it does.
+1