Monday, 29 January 2018

How many ways thread can implemented?

There are two different ways to specify which code to run in that Thread: 
-Implement the interface java.lang.Runnable .
- pass an instance of the class implementing it to the Thread constructor. Extend Thread itself and override its run() method.

No comments:

Post a Comment