interface IIA{
void getAge();
}
class CallBackDemo implements IIA{
public void getAge() {
System.out.println("3");
}
public void dosome(){
B b = new B();
System.out.println("4");
b.doSomething(this);
System.out.println("5");
}
public static void main(String[] args) {
new CallBackDemo().dosome();
}
}
class B {
public void doSomething(IIA a){
System.out.println("1");
a.getAge();
System.out.println("2");
}
}