java
yuanhisn
这个作者很懒,什么都没留下…
展开
-
Java Blocking Queue
A blocking queue is a queue that blocks when you try to dequeue from it and the queue is empty, or if you try to enqueue items to it and the queue is already full. A thread trying to dequeue from an ...原创 2015-08-05 22:58:46 · 203 阅读 · 0 评论 -
Why String is immutable in Java?
String is an immutable class in Java. An immutable class is simply a class whose instances cannot be modified. All information in an instance is initialized when the instance is created and the infor...原创 2015-05-16 11:38:10 · 58 阅读 · 0 评论 -
Producer Consumer using BlockingQueue
Usage example, based on a typical producer-consumer scenario. Note that a BlockingQueue can safely be used with multiple producers and multiple consumers. class Producer implements Runnable { ...原创 2015-03-24 10:33:38 · 55 阅读 · 0 评论