📄 mythread.java
字号:
class Mythread
{
public static void main(String args[])
{
Thread t=Thread.currentThread();
System.out.println("当前线程是:"+t);
t.setName("MyJavaThread");
System.out.println("当前线程是:"+t);
try
{
for(int i=0;i<3;i++)
{
System.out.println(i);
Thread.sleep(1500);
}
}
catch(InterruptedException e)
{
System.out.println("主线程被中断");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -