tag:blogger.com,1999:blog-7251932379641565080.post1644586661508858253..comments2023-07-24T21:20:27.110+05:30Comments on IT magazine: Java Threads M Vishnuvardhan Reddyhttp://www.blogger.com/profile/02937985266591259988noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-7251932379641565080.post-41974697072941803692019-03-28T11:33:18.791+05:302019-03-28T11:33:18.791+05:30This is because a class implemented by Runnable in...This is because a class implemented by Runnable interface can not use all the thread class methods. In order to use thread methods the Runnable object is passed to Thread constructor which then creates an Thread class object which can use all the methods of Thread and when ever run() is invoked it is redirected to Runnanble interface run()M Vishnuvardhan Reddyhttps://www.blogger.com/profile/02937985266591259988noreply@blogger.comtag:blogger.com,1999:blog-7251932379641565080.post-63558258058742494122018-09-13T14:57:01.003+05:302018-09-13T14:57:01.003+05:30I would like to add something I know...
If the cl...I would like to add something I know...<br /><br />If the class which we are going to extend from Thread class is not extended previously by any other class, we can easily extend it from Thread class.<br /><br />If it is already extended by some other class, it will be impossible to extend from Thread class. Because, "A class must have only one parent class".,i.e.,Multiple Inheritance is not allowed in Java. That's why we have to implement Runnable interface which contains only run() method and then redefine run(). <br /><br />Then I want some clarity, what is the purpose of passing the Runnable object as an argument for Thread class? Anonymoushttps://www.blogger.com/profile/14700019063320919169noreply@blogger.com