• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread related

 
Shishir malviya
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In any class can we extend and implement the Thread Class and Runnable Interface simultaneously.
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes u can!!
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The general rule of thumb is " Implement Runnable if you need to run any task in a separate thread and Extend Thread if you need to inherit the thread properties for the class in addition to running the task in itself "
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But why you need to extend & implement it simultaneously. The thread class has already implemented the runnable interface.

Srini
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic