Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Java > Core Java

Core Java Core Java Interview Questions, Learn by sharing Core Java Interview Questions asked in various companies, Get Career advices, Interview Procedures from Core Java experts, Post asked Core Java Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-29-2008, 09:27 AM
Senior Member
 
Join Date: Feb 2008
Posts: 1,210
Default Which one is the better thread implemented

Which one is the better thread implemented thread or extended ?
Reply With Quote
  #2 (permalink)  
Old 07-25-2008, 06:58 AM
Member
 
Join Date: Jul 2008
Location: West Bengal,India
Posts: 48
Default

Implementing runable interface is better than extending thread class.
In java we can extends only one class so there may be a situation where we have to extends a particular class and also have to maintain thread. There we have to extend the particular class and have to user implements runable interface.
so programming with implementing runable interface is the better programming practice.
__________________
Asit Kumar Purohit.
SRIC,IIT Kharagpur.
West Bengal,India
Mail me
Reply With Quote
  #3 (permalink)  
Old 08-01-2008, 07:40 AM
Junior Member
 
Join Date: Aug 2008
Location: noida
Posts: 7
Default

1 another thing, by extending thread u r taking complete overhead of the thread class where as by implementing Runnable u are just registering ur class with thread, whenever u requird just call its start method and start enjoying wth thread
Reply With Quote
Reply

Tags
core java, java, software

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On