-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDummyThreadFun.java
32 lines (29 loc) · 963 Bytes
/
DummyThreadFun.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* DummyThreadFun
*/
/**
* InnerDummyThreadFun
*/
class ThreadFun extends Thread {
@Override
public void run() {
System.out.println("name : " + this.getName());
System.out.println("id : " + this.getId());
System.out.println("priority : " + this.getPriority());
System.out.println("state : " + this.getState());
System.out.println("this : " + this);
System.out.println("isAlive : " + this.isAlive());
this.setName("junk");
System.out.println("name : " + this.getName());
System.out.println("currentThread : " + Thread.currentThread());
}
}
public class DummyThreadFun {
public static void main(String[] args) {
System.out.println("currentThread : " + Thread.currentThread());
ThreadFun tf = new ThreadFun();
tf.start();
System.out.println(tf.isAlive());
System.out.println("currentThread : " + Thread.currentThread());
}
}