-
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
-
不错的药房管理系统,拥有完善的管理查询功能 值得看看哦!...
不错的药房管理系统,拥有完善的管理查询功能 值得看看哦!-good pharmacy management system, it has a good management of the inquiry should look at oh!
- 2022-03-23 23:47:15下载
- 积分:1
-
15 wonderful characters three
15 奇妙的三维文字按钮,只是些基本的编成,初学者是不错的选择!-15 wonderful characters three-dimensional buttons, but some basic makeup and beginners is a good choice.
- 2022-03-05 19:05:02下载
- 积分:1
-
显示html的标签和视图。两个都有源代码和例子。
显示html的标签和视图。两个都有源代码和例子。- Demonstrates html the label and the view. Two all active codes
and example.
- 2022-02-02 08:04:12下载
- 积分:1
-
模拟液晶显示时钟
模拟液晶显示时钟-analog LCD Clock
- 2022-02-25 14:11:30下载
- 积分:1
-
模拟量节点模拟显示程序。比如汽车仪表盘,电压,油压量的显示...
模拟量节点模拟显示程序。比如汽车仪表盘,电压,油压量的显示
- 2022-12-18 16:50:03下载
- 积分: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
-
static控件的类
static控件的类-category
- 2022-03-21 07:46:11下载
- 积分:1
-
Paper model
论文样板――酒店客房管理系统论文.doc,做毕业设计的同学注意了,很好的参考资料-Paper model- hotel rooms management system thesis. Doc, so the attention of graduate design students, and a very good reference
- 2022-01-31 02:52:39下载
- 积分:1
-
实现的具有滑动功能的static类,用于控制声音的大小
实现的具有滑动功能的static类,用于控制声音的大小-Achieved with a sliding function of static class is used to control the size of the sound
- 2023-06-03 00:50:03下载
- 积分:1