-
public class Server extends Thread { Client client int counter public Server(Cli...
public class Server extends Thread { Client client int counter public Server(Client _client) { this.client = _client this.counter = 0 } public void run() { while (counter < 10) { this.client.queue.addElement(new Integer(counter)) counter++ } throw new RuntimeException("counter >= 10") } public static void main(String[] args) { Client c = new Client() Server s = new Server(c) c.start() s.start() } } class Client extends Thread { Vector queue public Client() { this.queue = new Vector() } public void run() { while (true) { if (! (queue.size() == 0)) { processNextElement() } } } private void processNextElement() { Object next = queue.elementAt(0) queue.removeElementAt(0) System.out.println(next)-public class Server extends Thread { Client client int counter public Server(Client _client) { this.client = _client this.counter = 0 } public void run() { while (counter lt; 10) { this.client.queue.addElement(new Integer(counter)) counter++ } throw new RuntimeException("counter gt;= 10") } p
- 2022-02-21 05:44:37下载
- 积分:1
-
一个可自动演示的图片控件
一个可自动演示的图片控件-a demonstration of the automatic controls Photo
- 2023-08-05 03:10:03下载
- 积分:1
-
背景和字体属性可改变的静态控件
背景和字体属性可改变的静态控件-The static control which can change its own background and font
- 2023-08-28 12:30:03下载
- 积分:1
-
操作2
操作2进制文件源码,对该文件进行读写操作数据输出到txt文件中-Operate 2-band source document, the document to read and write operation of data output to txt file
- 2023-04-22 16:45:03下载
- 积分:1
-
电子8段管,可以显示任意数字
电子8段管,可以显示任意数字-eight of electronic tubes, arbitrary figures show
- 2022-04-28 10:25:17下载
- 积分:1
-
数据上传源码用于ACCESS数据库请大家参考
数据上传源码用于ACCESS数据库请大家参考-From the data source for the ACCESS database please refer to
- 2023-05-19 05:05:03下载
- 积分:1
-
显示弯曲移动文字的静态控件
显示弯曲移动文字的静态控件-The static contorl which display curve text
- 2022-02-02 08:25:32下载
- 积分:1
-
Library management system papers, very good graduation design reference, we down...
图书管理系统论文,很好的毕业设计参考资料,大家下载-Library management system papers, very good graduation design reference, we download
- 2022-11-11 19:10:03下载
- 积分:1
-
- 2022-11-23 17:00:03下载
- 积分:1
-
A Static control, can simulate the number of open entry, open a panel. On Off t...
一个Static控件,可以模拟数字开入,开出板.
OnOff两种状态,显示为两种颜色.左键点击可以改变开入量的状态-A Static control, can simulate the number of open entry, open a panel. On Off two states, shown as two colors. Left-click to open into the volume can change the state of
- 2022-02-15 04:48:25下载
- 积分:1