Creating a New Thread

Q

How to create a thread in a program?

✍: FYIcenter

A

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.

2016-06-25, 434729👍, 8💬