5黑马币
最佳答案package com.itheima.day19;
public class Test01 {
public static void main(String[] args) {
/*
* 模拟两个人向银行存钱,每次存300,两个人总共存十次
*/
MyRunnable mr = new MyRunnable();
new Thread(mr,"MCC").start();
new Thread(mr,"BZ").start();
}
}
class MyRunnable implements Runnable {
private int count = 1;
@Override
public void run() {
while(true) {
try {
Thread.sleep ...
| |
| |