O'Reilly logo

The class of Java by Pravin Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 16

Multi-threading

What is a thread? A thread executes a sequence of steps. The code in a method defines a series of actions. A thread executes the statements in a method sequentially. A thread is a sequence of execution. The statements in a method define a sequence of execution. A thread executes statements in a method one by one. Some of the statements being executed result in invocation of another method or constructor.

Every thread has a task, which it is executing. The task for a thread is defined in a method, which it is supposed to finish. What is required by a thread for executing the task (method)? In Java a thread uses a runtime stack to carry out its task. Initially the runtime stack is loaded with the method (frame is created) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required