编写一个多线程的java 程序

2020-06-28 教育 118阅读
public class DoubleThread {
public static void main(String[] args) {
Thread t1 = new Thread() {
@Override
public void run() {
for (char i = 'a'; i <= 'z'; i++) {
System.out.println(i);
}
}
};
Thread t2 = new Thread() {
@Override
public void run() {
for (char i = 'A'; i <= 'Z'; i++) {
System.out.println(i);
}
}
};
t1.start();
t2.start();
}
}
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com