1. There is a thread class object (implemented by inheriting the thread class), and if the program has never called the object's start () method to start it, then the thread object will always be in the "new" state, which is never an opportunity for the thread to execute, just a normal Java object, When calling its run () method directly, it is no different from ordinary methods of ordinary Java objects.
2. static method by adding synchronized keyword to achieve synchronization, at this time the method locks the object is the current class, That is Xxx.class, instead of a static method to achieve synchronization, you can directly add synchronized keyword to the method, or synchronized (this) {} to implement, at this time, the object is locked is an instance of the class object. Therefore, the static synchronization method and the synchronous code block with this as the synchronization monitor can be executed concurrently. The static synchronization method and the synchronous code block with the current class as the synchronization monitor cannot be executed concurrently.
3. Each class first executes the main thread to allocate memory and initialize.
Multi-threaded traps