Note: If class A inherits method M from two classes, B and C, and the method interface for M is not identical in classes B and C (say M in B returns an object of class X, and M in C returns an object of an unrelated class Y), then the inheritance is invalid, unless a valid method override of M is defined in class A that resolves the method interface conformance problem. It is not always possible to do so (in which case the inheritance is not valid), but there are some cases in which it can be done. For example, if it is possible to define Z as a class that inherits X and Y, then a method override for M could be specified in class A, returning an object of class Z.