摘要: 线程间通信 共分成四块代码 如下: 代码一: public class Student { String name; int age; } 代码二: public class SetThread implements Runnable { private Student student; priva 阅读全文
posted @ 2022-04-12 08:46 a-tao必须奥利给 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 线程安全问题 先看一段代码 public class TicketWindow3 implements Runnable{ //由于这个类的对象只创建一次,也就只有一个对象,就只有一个tickets变量 private int tickets = 100; // 1 @Override public 阅读全文
posted @ 2022-04-12 08:19 a-tao必须奥利给 阅读(24) 评论(0) 推荐(0) 编辑