package Thread;
public class Demo2 {
public static void main(String[] args) throws InterruptedException {
System.out.println(Thread.currentThread());
Thread thread=new Thread() {
@Override
public void run() {
System.out.println(this.getName());
System.out.println(currentThread());
}
};
Thread thread2=new Thread("当前自定义线程") {
@Override
public void run() {
System.out.println("子线程");
}
};
thread.setPriority(10);
thread.start();
thread.sleep(5000);
boolean proteced=thread.isDaemon();
long id=thread.getId();
String nameString=thread.getName();
int pp=thread.getPriority();
boolean isAlive=thread.isAlive();
boolean i=thread.isInterrupted();
}
}