![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JDK.Lib
OHISAY
java
展开
-
Exception
1 自定义异常 2 实现代码class MyException extends Exception{ private String message; public MyException(String message){ this.message = message; } public void getmessage(){ ...原创 2018-07-02 21:48:54 · 138 阅读 · 0 评论 -
Thread
1概览 2 实现代码。 并行, 两个cpu干活; 并发,一个cpu干很多活。 thread.sleep 不释放锁, object.wait 释放锁 t.start() 转运行态; t.run(), 相当于调用函数。 public class Test{ public static int sum = 0; public final stat...原创 2018-07-03 19:58:06 · 200 阅读 · 0 评论 -
Thread ReentrantLock
1 限时锁 和 公平锁2 代码实现public class TimeLock implements Runnable{ public static ReentrantLock reentrantLock = new ReentrantLock(); public void run() { try { if (reentrantL...原创 2018-07-05 18:41:44 · 119 阅读 · 0 评论 -
Thread Semaphore
1 信号量2 实现代码。 public class SemapDemo implements Runnable{ public final Semaphore semaphore = new Semaphore(5);//once 5 thread @Override public void run() { try { ...原创 2018-07-05 18:42:52 · 257 阅读 · 0 评论 -
Thread CountDownLatch
1 计时器2 代码实现public class CountDownLatchDemo implements Runnable{ public static final CountDownLatchDemo demo = new CountDownLatchDemo(); public static final CountDownLatch end = new Coun...原创 2018-07-05 18:47:12 · 281 阅读 · 0 评论 -
Thread ReentrantReadWriteLock
1 读写锁2 实现。 public class ReadWriteLockDemo { public static Lock lock = new ReentrantLock(); public static ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock(); ...原创 2018-07-05 18:45:03 · 90 阅读 · 0 评论 -
java.text.SimpleDateFormat
原创 2018-08-09 21:25:17 · 779 阅读 · 0 评论