?? cubbyhole.java
字號:
/* ========================================================= CubbyHole CubbyHole is a synchronized storage location for a single value of type Object. CubbyHole has two methods. Put and Get. Both are synchronized so one cannot run whilst other threads are running synchronized methods (i.e. Put and Get) within this Object. ========================================================= */public class CubbyHole{ private Object contents; /* ========================================================== Method for getting an Object from the buffer ========================================================== */ public synchronized Object get() { return contents; } /* ========================================================== Method for putting object into buffer ========================================================== */ public synchronized void put(Object value) { contents = value; }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -