diff --git a/test/com/platform/test/MyTestThread.java b/test/com/platform/test/MyTestThread.java new file mode 100644 index 00000000..82e240c4 --- /dev/null +++ b/test/com/platform/test/MyTestThread.java @@ -0,0 +1,22 @@ + +package com.platform.test; + +public class MyTestThread extends Thread{ + + public MyTestThread() { + this.setDaemon(true); + } + + @Override + public void run() { + for (int i = 0; i < 1000; i++) { + System.out.println(i); + try { + Thread.sleep(5); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } +} diff --git a/test/com/platform/test/testThread.java b/test/com/platform/test/testThread.java new file mode 100644 index 00000000..28322553 --- /dev/null +++ b/test/com/platform/test/testThread.java @@ -0,0 +1,12 @@ +package com.platform.test; + + +public class testThread { + + public static void main(String[] args) { + MyTestThread thj = new MyTestThread(); + thj.start(); + System.err.println(thj.isDaemon()); + } + +}