public class dailyCode {
public interface Callback {
public void getOdd();
public void getEven();
}
public static void main(String[] args){
dailyCode.Callback callback = new dailyCode.Callback() {
@Override
public void getOdd() {
System.out.println("getOdd");
}
@Override
public void getEven() {
System.out.println("getEven");
}
};
for(int i=1; i<=5; i++){
if(i%2==0) {
callback.getEven();
} else {
callback.getOdd();
}
}
}
}