Next: Creating a threaded class
Up: Threads
Previous: Thread states
Contents
- Extend the java.lang.Thread class and override its run() method.
- The run() method defines the behavior of the thread while it is running.
- When the run() method ends, the thread goes into the dead state.
- As a developer, you call the start() method of the thread; the JVM calls the run() method.
- Never call the run() method directly.
Next: Creating a threaded class
Up: Threads
Previous: Thread states
Contents