public class MainClass {
public static void main(String[] argv) {
MySubInterface sub = new MyClass();
MyInterface i = sub;
}
}
interface MyInterface {
public void aMethod();
}
interface MySubInterface extends MyInterface {
public void bMethod();
}
class MyClass implements MySubInterface {
public void aMethod() {
}
public void bMethod() {
}
}
|