DEVFYI - Developer Resource - FYI

How to create a thread in a program?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

34. How to create a thread in a program?

You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Runnable interface. Put jobs in a run() method and call start() method to start the thread.

(Continued on next question...)

Other Interview Questions