-
"X extends Y" is correct if and only if X is a class and Y is an interface
-
"X extends Y" is correct if and only if X is an interface and Y is a class
-
"X extends Y" is correct if X and Y are either both classes or both interfaces
-
"X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
In Java, 'extends' is used for both class inheritance and interface extension, but the types must match. A class can extend another class, and an interface can extend another interface. Option C correctly states that X extends Y works when both are classes or both are interfaces. Options A and B are wrong because a class cannot extend an interface (that's 'implements'), and an interface cannot extend a class. Option D is wrong because mixing classes and interfaces with 'extends' is invalid.