-
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
-
VC, do a bit of a BT things, as is done in the laboratory, the Task Manager can...
我刚学VC,做了一个有点BT的东西,由于是在实验室做的,任务管理器不能用,很多人不知道怎么关,很郁闷~!-VC, do a bit of a BT things, as is done in the laboratory, the Task Manager can not use it, many people do not know how customs, very depressed ~!
- 2022-03-29 05:31:16下载
- 积分:1
-
static auto external等的定义静态变量的用法
static auto external等的定义静态变量的用法-static auto external variables such as the usage of the definition of static
- 2022-02-01 01:16:10下载
- 积分:1
-
variable static text control
可变的静态文本控件-variable static text control
- 2022-08-20 23:29:45下载
- 积分:1
-
windows窗口下的滚动条制作,界面部分可在工具栏下添加
windows窗口下的滚动条制作,界面部分可在工具栏下添加-windows under the scroll bar window production, the interface part of the toolbar, add
- 2023-07-18 03:55:03下载
- 积分:1
-
互联网技术教案
互联网技术教案-Internet technology curriculum
- 2022-07-14 00:25:23下载
- 积分:1
-
playmci algorithm and the experimental procedure issues
c语言实现playmci的算法以及实验程序课题-playmci algorithm and the experimental procedure issues
- 2022-02-11 12:43:36下载
- 积分:1
-
Good inventory management system
很好的库存管理系统--可以做毕业设计用,很好的库存管理系统--可以做毕业设计用-Good inventory management system- can do graduation project, and good inventory management system- can do graduate design
- 2022-10-23 05:25:03下载
- 积分:1
-
关于给初学者介绍SDK编程
关于给初学者介绍SDK编程- About gives the beginner to introduce SDK programs
- 2022-12-18 22:50:03下载
- 积分:1
-
fgsdfgsdfgsdg
UC3842高性能电流模式控制器-fgsdfgsdfgsdg
- 2022-08-22 23:05:22下载
- 积分:1