Govt. Exams
Entrance Exams
Advertisement
Topics in Java Programming
Which method is used to stop a thread in Java?
Correct Answer:
B. interrupt()
EXPLANATION
The interrupt() method is the proper way to stop a thread in Java. The stop() method is deprecated and dangerous.
Which interface must be implemented to create a thread in Java?
Correct Answer:
A. Runnable
EXPLANATION
The Runnable interface is the correct interface to implement for creating threads in Java. It has a single abstract method run().