Candibiotic
News Update :

English Premier League

Bundesliga

La Liga

Showing posts with label Defining. Show all posts
Showing posts with label Defining. Show all posts

Defining, Instantiating, Starting Threads

Friday, August 21, 2009

Threads can be created by extending Thread and overriding the public void run() method.
Thread objects can also be created by calling the Thread constructor that takes a Runnable argument. The Runnable object is said to be the target of the thread.
You can call start() on a Thread object only once. If start() is called more than once on a Thread object, it will throw a RuntimeException.
It is legal to create many Thread objects using the same Runnable object as the target.
When a Thread object is created, it does not become a thread of execution until its start() method is invoked. When a Thread object exists but hasn't been started, it is in the new state and is not considered alive.

Football News

 

© Copyright Vinayak Wins 2010 -2011 | Design by Herdiansyah Hamzah | Published by Borneo Templates | Powered by Blogger.com.