package DataStructures.Lists; import java.util.Objects; public class CursorLinkedList<T> { private static class Node<T> { T element; int next; Node(T ...
分类:
其他好文 时间:
2019-11-22 01:24:18
阅读次数:
76
1,private static final long serialVersionUID=...是干什么的 修改了此类,要修改这个值,用以前老版本得嘞序列化的类恢复时会出错, 为了反序列化时确保类版本的兼容性,具体数值自己定义 上边的忽略看下边的正解: 主要用于序列化和反序列化时之间的转换 用于版本 ...
分类:
其他好文 时间:
2019-11-21 14:17:32
阅读次数:
82
一个生产者和一个消费者 public class ConditionTest { private static ReentrantLock lock = new ReentrantLock(); private static Condition condition = lock.newConditi ...
分类:
其他好文 时间:
2019-11-17 23:59:56
阅读次数:
112
1.自定义容器,意在通过组合方式注入获取Iprovider 1 public class AppDependencyResolver 2 { 3 private static AppDependencyResolver _resolver; 4 5 public static AppDependen ...
分类:
Web程序 时间:
2019-11-16 23:21:50
阅读次数:
130
PHP pdo单例模式连接数据库<pre><?php class Db{ private static $pdo; public static function getPdo () { var_dump(self::$pdo); echo '</br>'; if ( self::$pdo == nu ...
分类:
数据库 时间:
2019-11-16 14:59:51
阅读次数:
149
<pre><?php/** * This is a Redis exntend class */ class RedisClient{ private static $instance = NULL; /** * Get a instance of MyRedisClient * * @param ...
分类:
Web程序 时间:
2019-11-16 14:19:34
阅读次数:
101
有一个大小为50000的数组,要求开启5个线程分别计算10000个元素的和,然后累加得到总和 public class Test5 { private static Random random = new Random(); public static void main(String[] args ...
分类:
其他好文 时间:
2019-11-16 12:38:32
阅读次数:
76
public class DbOpenHelper extends SQLiteOpenHelper { private static String name = "test.db"; /* 数据库名称 */ private static int version = 1; /* 数据库版本号 */ ... ...
分类:
移动开发 时间:
2019-11-15 20:28:16
阅读次数:
96
public class ThreadLocalCache { private static ThreadLocal<Map<String, Object>> cache=new ThreadLocal<Map<String,Object>>(); /** * 从ThreadLocal里获取缓存的值 ...
分类:
编程语言 时间:
2019-11-15 18:39:56
阅读次数:
83
countdownlatch 一个线程等待其他线程完成了再接着往下执行 public class CountDownLatchExample { private static ExecutorService executorService = Executors.newFixedThreadPool ...
分类:
其他好文 时间:
2019-11-13 00:30:45
阅读次数:
76