class. Hierarchical unit shows top down style through splitting a compound class into several simple sub
classes.
The class reddishbrown
is derived from classes orange and violet. The class yellowish-
brown is derived from classes green and orange and lastly the class bluishbrown is derived from
violet and green.
In function main(), objects of classes reddishbrown, yellowishbrown, and bluishbrown
are declared. When objects are declared constructors are executed from base to derived classes. Constructor
when executed displays the class name (colour name). The output shows names of different colours ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.