Back to Top

Sunday, 15 January 2012

JAVA : Diff between Runnable Interface and Thread class while using threads.

1. If you want to extend the Thread class then it will make your class unable to extend other classes as java is having single inheritance feature whereas If you implement runnable interface, you can gain better object-oriented design and consistency and also avoid the single inheritance problems.

2. Extending the thread will give you simple code structure in comparison to Runnable Interface.

3. Using Runnable Interface, you can run class several times whereas Thread have the start() method that can be called only once.

0 Responses to “ JAVA : Diff between Runnable Interface and Thread class while using threads. ”

Post a Comment

Popular Posts

Subscribe via Email
Subscribe Java Interview Questions via Email
All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar