/**
* 获取单例
* @return
*/
public static AESUtils getInstance(){
if(aesUtils == null){
// 当需要创建的时候在加锁
synchronized(AESUtils.class) {
if (aesUtils == null) {
aesUtils = new AESUtils();
init();
}
}
}
return aesUtils;
}
转载于:https://www.cnblogs.com/zeenzhou/p/11243415.html