Apple Interview Question
Software Engineer / DevelopersI really think in new version of JDK the thread call can be option to create a new thread because we should be able create a thread just implementing an interface or even using an annotation. The code to create a thread is should not imposed to application developer rather should be handle at JVM level by annotation processing tool like when annotate class with @Servlet it become a servlet in servlet 3.0 spec.
If you implement the Runnable interface, you can only override and use the run() method. However, if you wish to use method related to parallel processing, the Thread class would be useful. The thread class provides methods like activeCount(),destroy(),dumpStack().. etc. Hence, if you need to use more than just the run() method, the thread class is useful.
- MS February 28, 2011