The keywords synchronized and volatile , used to control execution of code in objects that may participate in multiple threads. The methods wait , notify , and notifyAll defined in java.lang.Object , used to coordinate activities across threads. This section presents examples of these constructs, along with boxed summaries of notation and conventions. It concludes with a reference summary of principal Java concurrency constructs and their properties. A client is just any Java object that sends a request to another Java object, and a server is just any object receiving such a request.
Most objects play the roles of both clients and servers.
Threads provide another option. The Java Thread framework allows an activity to be initiated in a new thread, causing it to proceed asynchronously. Nearly any kind of activity can be performed in a Java Thread . Here is a class describing objects that print a message to a java.awt.TextArea when their run method is invoked. The methods part of a box is omitted when there is no reason to list any of the methods.