public class Test {
public static void main(String[] args) {
InterfaceReturn interfaceReturn=new InterfaceReturn();
interfaceReturn.setonclick(new InterfaceReturn.MyInterface() {
@Override
public void onclick(int position) {
// TODO Auto-generated method stub
System.out.println(this);
}
});
}
public static void main(String[] args) {
InterfaceReturn interfaceReturn=new InterfaceReturn();
interfaceReturn.setonclick(new InterfaceReturn.MyInterface() {
@Override
public void onclick(int position) {
// TODO Auto-generated method stub
System.out.println(this);
}
});
}
}
public class InterfaceReturn{
MyInterface myInterface;
public void setonclick(MyInterface i){
myInterface=i;
}
public void loading(){
if(null != myInterface)
myInterface.onclick(0);
System.out.println("InterfaceReturn------------->"+this);
}
public interface MyInterface{
public void onclick(int position);
}
}