FirstNaukri
Home Search Jobs Govt JobsNew Resume Makernew Career Guidance Ask n Answer Student Ambassadors

Register|Login

  Ask n Answer
  Ask a Question
0 out of 300 characters

QUESTION
how to cerate thread in java?
By EGAVINTI VENKATAR... (Beginner)  8 years ago   19 views
 
 Your Answer
0 out of 1250 character
 
 
 
Share |
Report Abuse
 
 
 
 
ANSWERS (3)
 
 
 
 
'THREAD CREATION'
The second way to specify what code a thread should run is by creating a class that implements java.lang.Runnable. The Runnable object can be executed by a Thread. To have the run() method executed by a thread, pass an instance of MyRunnable to a Thread in its constructor. Here is how that is done:
 
 
 
Know a better answer? Click here to post.
 
 
 
Know a better answer? Click here to post.
 
 
It is a lengthy question.
Use Thread class and extend a class from it.(simplest)
 
 
 
Know a better answer? Click here to post.
 
 
 
 
 

Ask & Answer
Panel of Experts

 
 
 
 
 
All rights reserved © 2022 Info Edge (India) Ltd.