/** Find out whether interfaces are inherited.
* Start with Thread which implements Runnable.
*/
publicclass InterfaceInherit extends Thread {
publicstaticvoid main(String[] a) {
new InterfaceInherit().start();
}
publicvoid run() {
if (thisinstanceof InterfaceInherit)
System.out.println("This is InterfaceInherit");
if (thisinstanceof Thread)
System.out.println("This is Thread");
if (thisinstanceof Runnable)
System.out.println("This is Thread -- Interfaces ARE inherited!");
}
}