Java 原生实现CallBack、JUnit 单元测试简单使用

Java 原生实现CallBack

 

 

定义一个callBack 函数接口:

 

/**
 * 版权所有 (c) 2016,xiaoming有限公司  
 */
package helloTest;
/**
 * 类说明
 * 
 * 
 * Modify Information:
 * Author        Date          Description
 * ============ =========== ============================
 * DELL          2017年1月9日    Create this file
 * 
* */ public interface CallBackClass { public void whenCall(); }

 

 

 

类的函数执行完之后进行调用callBack 函数接口:

 

/**
 * 版权所有 (c) 2016,xiaoming有限公司  
 */
package helloTest;
/**
 * 类说明
 * 
 * 
 * Modify Information:
 * Author        Date          Description
 * ============ =========== ============================
 * DELL          2017年1月9日    Create this file
 * 
* */ public class TestCallBack { public void work(int n, CallBackCla

你可能感兴趣的:(实战,Java,并发编程)