Well, here is the full solution for you:
public interface I1 {}
public interface I2 {}
public interface I3 extends I1, I2 {}
public interface I4 {}
public class X implements I3 {}
public class W extends X implements I4 {}
public class InstanceofTest {
public static void main(String[] args){
W w = new W();
if (w instanceof I1)
System.out.println("W implements I1");
if (w instanceof I2)
System.out.println("W implements I2");
if (w instanceof I3)
System.out.println("W implements I3");
if (w instanceof I4)
System.out.println("W implements I4");
if (w instanceof X)
System.out.println("W extends X");
}
}
And the result will be that W
implements every interface and extends X
.