2016年5月27日
摘要: public class Demo { public static void main(String[] args) { long start = System.currentTimeMillis();//当前系统时间 Runtime runtime = Runtime.getRuntime(); System.out.p... 阅读全文
posted @ 2016-05-27 16:06 wzyy 阅读(201) 评论(0) 推荐(0)
摘要: public final class StringBuffer extends AbstractStringBuilder implements java.io.Serializable, CharSequence public final class StringBuilder extends A 阅读全文
posted @ 2016-05-27 14:01 wzyy 阅读(206) 评论(0) 推荐(0)
摘要: 使用同步synchronized可以解决数据错位问题 使用super.wait(),super.notify();可以解决重复生产问题 思路:对于生产者:如果不可以生产,就休眠,等待正在取数据的消费者唤醒,被唤醒后,再生产,生产完成后唤醒消费者;消费者被唤醒后取数据,取完再唤醒生产者生产 对于消费者 阅读全文
posted @ 2016-05-27 11:18 wzyy 阅读(303) 评论(0) 推荐(0)