@Test
    public void testDemo3() throws Exception {
        //声明一个线程池
        ExecutorService ex = Executors.newCachedThreadPool();
        for (int i = 0; i < 4; i++) {
            final int a = i;

            //每一次execute方法，都是向池中放入一个对象
            ex.execute(new Runnable() {
                public void run() {
                    int l = 0;
                    while (l < 10) {

                        System.err.println("测试...." + a + ">"

                        + Thread.currentThread().getName() + ","

                        + Thread.currentThread().isDaemon());

                        try {
                            Thread.sleep(2000);
                            l++;
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
            });
        }

        //Thread.sleep(1000 * 60 * 60);
    }