Example & Tutorial understanding programming in easy ways.

When to use Runable and Thread in java?

As we know we can implement thread either by extending Thread class or implementing Runnable interface, question arise, which one is better and when to use one?

This question will be easy to answer, if you know that Java programming language doesn't support multiple inheritance of class, but it allows you to implement multiple interface. Which means, its better to implement Runnable than extends Thread, if you also want to extend another class e.g. Canvas or CommandListener.

Read More →