1 public class StreamUtils { 2 3 4 5 private static final List listInteger = Lists.newArrayList(1, 2, 3, 4, 5, 6, 3, 5, 1, 4, 2, 8, 9); 6 7 private st... ...
分类:
编程语言 时间:
2018-12-09 16:09:47
阅读次数:
183
*/@Componentpublic class NumberPlaceDBToRedis implements ApplicationListener<ApplicationEvent> { private static final Logger logger = Logger.getLogger ...
分类:
其他好文 时间:
2018-12-08 22:39:42
阅读次数:
184
class Memcache{ private static $mem = null; public function mem_create(){ self::$mem = new \Memcache(); self::$mem->connect('127.0.0.1'); } public fun... ...
分类:
系统相关 时间:
2018-12-08 13:24:02
阅读次数:
168
1 public class Voter { 2 String name; //名字 3 private static int count; //投票数 4 5 public Voter() {} 6 7 public Voter(String name) { 8 this.name=name; 9... ...
分类:
其他好文 时间:
2018-12-05 22:55:07
阅读次数:
257
class Program { private static readonly object obj = new object(); static void Main(string[] args) { Thread th1 = new Thread(TestLock); Thread... ...
import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; /** * AES加密解密算法 * 默认采用AES-128-ECB加密模式 */ public class AESUtils { private static fi... ...
分类:
编程语言 时间:
2018-12-05 12:31:54
阅读次数:
1318
package com.links.dao.impl; import java.sql.*; public class JDBCUtil { // 数据库驱动类?? private static final String Driver = "oracle.jdbc.driver.OracleDriv ...
分类:
数据库 时间:
2018-12-03 13:56:11
阅读次数:
217
还是套路问题,一种思想而已,两种方式 1 dubble check instance 2 static inner class 两次检测加类锁 静态内部类,其实就是饿汉模式,直接给你就好了 package Concurrency; class dubbleCheck{ private static ...
分类:
编程语言 时间:
2018-12-01 16:56:33
阅读次数:
230
private static String removePreviousString(String str,String strPre){ String[] strArray = str.split(",");//有冗余的权限,之前的权限和现在修改的权限 String[] strPreArray = ...
分类:
其他好文 时间:
2018-11-28 23:44:50
阅读次数:
175
public class TrinityLock { //为3表示允许两个线程同时获得锁 private final Sync sync = new Sync(3); private static final class Sync extends AbstractQueuedSynchronizer ...
分类:
其他好文 时间:
2018-11-28 12:35:39
阅读次数:
207