package mythread; public class CountOperate extends Thread{ public CountOperate(){ System.out.println("CountOperate---begin"); System.out.println("Thread.currentThread().getName()=" + Thread.currentThread().getName());//获取线程名 System.…
前言:在阅读<Java多线程编程核心技术>过程中,对书中程序代码Thread.currentThread()与this的区别有点混淆,这里记录下来,加深印象与理解. 具体代码如下: public class MyThread09 extends Thread { public MyThread09() { System.out.println("MyThread09 Constructor begin"); System.out.println("Thread.c…
Java多线程编程核心技术 这本书有利于对Java多线程API的理解,但不容易从中总结规律. JDK文档 1. Thread类 部分源码: public class Thread implements Runnable { private volatile char name[]; private int priority; private Thread threadQ; private long eetop; /* Whether or not to single_step this thre…