文件名称:Train
介绍说明--下载内容来自于网络,使用问题请自行百度
假设有火车票1000张,创建10个线程模拟10个售票点,每个售票点100毫秒售出一张票。请模拟并打印出售票过程。注意使用synchronized确保同一张票只能卖出一次。输出格式如下:
第4售票点卖出第100张票 第2售票点卖出第101张票……(Suppose there were 1000 tickets, 10 threads were created, 10 tickets were sold, and each ticket sold one ticket in 100 milliseconds. Please simulate and print the ticket selling process. Pay attention to using synchronized to ensure that the same ticket can only be sold once. The output format is as follows:
Fourth tickets sold 100th tickets, second tickets sold 101st tickets......)
第4售票点卖出第100张票 第2售票点卖出第101张票……(Suppose there were 1000 tickets, 10 threads were created, 10 tickets were sold, and each ticket sold one ticket in 100 milliseconds. Please simulate and print the ticket selling process. Pay attention to using synchronized to ensure that the same ticket can only be sold once. The output format is as follows:
Fourth tickets sold 100th tickets, second tickets sold 101st tickets......)
相关搜索: java
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Train
Train\.classpath
Train\.project
Train\.settings
Train\.settings\org.eclipse.jdt.core.prefs
Train\bin
Train\bin\Resource.class
Train\bin\Seller.class
Train\bin\Test.class
Train\src
Train\src\Test.java
Train\.classpath
Train\.project
Train\.settings
Train\.settings\org.eclipse.jdt.core.prefs
Train\bin
Train\bin\Resource.class
Train\bin\Seller.class
Train\bin\Test.class
Train\src
Train\src\Test.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.