Java Programming - Threads - Discussion
Discussion Forum : Threads - General Questions (Q.No. 6)
6.
Which two of the following methods are defined in class Thread?
- start()
- wait()
- notify()
- run()
- terminate()
Answer: Option
Explanation:
(1) and (4). Only start() and run() are defined by the Thread class.
(2) and (3) are incorrect because they are methods of the Object class. (5) is incorrect because there's no such method in any thread-related class.
Discussion:
2 comments Page 1 of 1.
Amit Kumar said:
8 years ago
run() is defined in Runnable interface instead of thread class and Thread(c) implements Runnable interface.
Ashok said:
9 years ago
What is the purpose of using terminate() in the thread?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers