|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Therunmethod gives a thread something to do. Its code implements the thread's running behavior. It can do anything that can be encoded in Java statements: compute a list of prime's, sort some data, perform some animation.The
Threadclass implements a generic thread that, by default, does nothing. That is, the implementation of itsrunmethod is empty. This is not particularly useful, so theThreadclass defines API that lets aRunnableobject provide a more interestingrunmethod for a thread.There are two techniques for providing a run method for a thread:
|
|
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.