Composition or Implementation Inheritance
With compositional inheritance, dogs will inherit from two ‘component’ classes: Color and Size.
This is ‘impure’ multiple inheritance in C++ ( impure because the two ancestor classes have nothing in common with animals, which may not behave well as clients of Color or Size ancestor methods).
Java does not have multiple inheritance - but any class may ‘implement’ the interfaces Color’ and ‘Size’ instead.
Dogs must then be eligible to inherit (C++) or implement (Java) all the methods of the Color and Size classes - an undesirable compromise. Over-riding only hides the mis-match between class Dog and Color or Size classes.