| Author |
Reg java.lang.Thread creation?
|
V. Potluri
Ranch Hand
Joined: Mar 29, 2007
Posts: 36
|
|
Hi All, In Page# 677 of SCJP5 by Kathy: It is discouraged to create a Thread using java.lang.Thread class because it is not good OO practise!!! It makes sense [from OO perspective] to extend java.lang.Thread is when you have a more specialized version of a Thread class. ***I didn't understand above statements. Kindly any one can give more detail info. related to above statements.**** Thanks in advance. Thanks, Potluri
|
 |
Srinivasan thoyyeti
Ranch Hand
Joined: Feb 15, 2007
Posts: 557
|
|
Hi, 1)People avoid creating Thread "by extending Thread" because They might need to extend another class. [they can't extend Thread here] 2)One will extend from thread, to override the current thread functions behavior ( They have their own design issues )
|
Thanks & Regards,<br />T.Srinivasan,<br />SCWCD 1.4(89%),SCJP 5.0(75%)<br />"That service is the noblest which is rendered for its own sake." - Mahatma Gandhi
|
 |
ramesh kumar
Greenhorn
Joined: Aug 15, 2006
Posts: 25
|
|
class Animal { } class Cat extends Animal { } Cat is one kind of Animal,here Cat inherits all the properties of animal and it can have it's own properties.So if you are extending one class from super class you are deriving one class specific to that super class. So if you are extending Thread you should be able to create specific kind Thread.That is why it is not good OO design.
|
 |
 |
|
|
subject: Reg java.lang.Thread creation?
|
|
|