this might not be the right place to ask this question as it was asked to me in an interview, but i would like to understand the oops concept behind it.
There are two base classes and a derived class:
class Car {}
class Paint {}
class Colors : Paint {}
So the question was what is the object oriented concept behind having Paint as a different base class and Colors as sub class to Paint class.
My confusion is that Paint is a base class and not a property of Car class. What OOP’s concept is applied here.
The concept is that some people have no concept. First, what is a “Colors” (don’t name classes with plural names). What behavior in Paint is inherited by Colors? Nothing as far as I can see. I have no clue what Colors is supposed to do.
Can a Color be used interchangeably with Paint? Not that I can imagine. Right off the bat it seems like a poor class hierarchy.
IMHO, the question is completely bogus.