Threads

Q1: Which will contain the body of the thread?

A main();

B start();

C run();

D stop();

ANS:A - run();

Option A is Correct. The run() method to a thread is like the main() method to an application. Starting the thread causes the object's run method to be called in that separately executing thread. Option B is wrong. The start() method causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread. Option C is wrong. The stop() method is deprecated. It forces the thread to stop executing. Option D is wrong. Is the main entry point for an application.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.