package com.jd.ls.job.destroy;
public interface ComputeCallBack {
public void onComputeEnd();
}
package com.jd.ls.job.destroy;
public class TestCallBack {
public void compute(int n, ComputeCallBack callback) {
for (int i = 0; i < n; i++) {
System.out.println(i);
}
callback.onComputeEnd();
}
public static void main(String[] args) {
new TestCallBack().compute(1000, new ComputeCallBack() {
@Override
public void onComputeEnd() {
System.out.println("end back!!!");
}
});
}
}