2012年8月10日
摘要: /** * 文件名: Customer.java * * 顾客 * **/public class Customer{ @SuppressWarnings("unused") private Shop shop = null; private String name = null; public void buy(){ int count = shop.getBreadCount(); if(count > 0){ shop.setBreadCount(--count); System.out.println(name +" says : I bought 阅读全文
posted @ 2012-08-10 15:13 cfd406635982 阅读(1034) 评论(0) 推荐(0) 编辑
摘要: package com.cfd.thread;/** * 死锁 * @author cfd * */class DLockThread extends Thread{ static Object a = new Object(); static Object b = new Object(); String firstObj = ""; public DLockThread(String firstObj, String threadName){ this.firstObj = firstObj; super.setName(threadName); } public vo 阅读全文
posted @ 2012-08-10 14:01 cfd406635982 阅读(306) 评论(0) 推荐(0) 编辑