1. If I try a finally object and try has a return object, will the finally object code run? If it is run, whether it is after return or before return: it will run and run after return.
2. After a thread enters a synchronized method of an object, can other threads access other methods of this object?
A: No. One Synchronized Method of an object can only be accessed by one thread.
3. What is the difference between a process and a thread?
A: A process is the unit of resource allocation and scheduling by the system. A thread is the unit of CPU scheduling and scheduling. A process can have multiple threads which share the resources of the process.
4. What is the difference between stack and stack?
A: Stack: the stack is automatically allocated and released by the compiler. Variables defined in the function body are usually on the stack.
Heap: usually assigned and released by programmers. The memory allocated by using new and malloc functions is on the heap.
5. Do I use run () or start () to start a thread ()?
When a thread is started, the START () method is called to make the virtual processor represented by the thread in a running state, which means that it can be scheduled and executed by JVM. This does not mean that the thread will run immediately. The run () method can generate the exit sign to stop a thread.