练习打卡,请老师检查~
来源:2-5 自由编程
Heijyu
2020-06-18 16:53:24
package com.imooc.thread_exercise; class MyThread extends Thread { public MyThread(String name) { super(name); } public void run() { for (int i = 1; i <= 10; i++) { System.out.println(getName() + "is printing" + i); } } } public class ThreadTest { public static void main(String[] args) { MyThread mt = new MyThread("Printer"); mt.start(); } }
1回答
同学你好,经测试代码是正确的,不错哟,继续加油!!
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
相似问题