class MyClass {
private class ClassB implements B {
private int i = 11;
public int value() {
return i;
}
}
protected class ClassA implements A {
private String label;
private ClassA(String whereTo) {
label = whereTo;
}
public String readLabel() {
return label;
}
}
public A dest(String s) {
return new ClassA(s);
}
public B cont() {
return new ClassB();
}
}
public class MainClass {
public static void main(String[] args) {
MyClass p = new MyClass();
B c = p.cont();
A d = p.dest("A");
}
}
interface B {
int value();
}
interface A {
String readLabel();
}
|