![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java学习笔记
文章平均质量分 72
蓝色的鲸
这个作者很懒,什么都没留下…
展开
-
线程的中断
中断并不是结束线程而是停止休眠。注意!!!!package method;/** * @auther 言行 */@SuppressWarnings({"all"})public class Method01 { public static void main(String[] args) throws InterruptedException { T t = new T(); t.setName("sb"); t.setPrior原创 2022-03-09 22:42:02 · 125 阅读 · 0 评论 -
多线程中的售票问题
在日常生活中我们可以观察到售票是多个窗口进行售票的,那么他是如何解决票如何卖完的呢。这里就涉及到了多线程的问题了。方案一:package thread;/** * @auther 言行 */public class SellTicket { public static void main(String[] args) { SellTicket01 sellTicket01 = new SellTicket01(); SellTicket01 s原创 2022-03-09 22:38:59 · 1176 阅读 · 1 评论