use of inheritance....
hi friends we are all say inheritance is one of the important concept in oops that will support ed by java,it will reduce the code length but in real world programming most of the cases we dont use inheritance concepts for user defined classes... My doubt is why we dont use
inheritance is real time programming...?
[329 byte] By [
83Krisha] at [2007-11-27 11:11:45]

> hi friends we are all say inheritance is one of the
> important concept in oops that will support ed by
> java,it will reduce the code length but in real world
> programming most of the cases we dont use inheritance
> concepts for user defined classes... My doubt is why
> we dont use
> inheritance is real time programming...?
If you're using inheritance to reduce the amount of code per class, you're abusing it. Extending a class just to re-use a handy method is a cowboy activity
Who said it isn't used? On what are you basng these claims? What exactly do you mean by "inheritance"? People have some misconceptions about inheritance
hmm, never noticed that I don't use inheritance...
Of course I don't go about thinking up complicated object hierarchies for the sake of it, but that's another story.
> hi friends we are all say inheritance is one of the
> important concept in oops that will support ed by
> java, it will reduce the code length but in real world
I agree with the people here when they disagree with you on this.
> programming most of the cases we dont use inheritance
> concepts for user defined classes...
Interesting. I thought every user-defined class is derived from Object. Besides that, maybe we often don't extend random classes all the time because we understand the OO design principles...
> My doubt is why
> we dont use
> inheritance is real time programming...?
I assume it's because most real-time programs are written in C or other structured languages. But I'm sure there are exceptions.
> > My doubt is why
> > we dont use
> > inheritance is real time programming...?
>
> I assume it's because most real-time programs are
> written in C or other structured languages. But I'm
> sure there are exceptions.
Well, the reason is probably the same as the one why "noone uses inheritance", in other words non-existent :)
> hi friends we are all say inheritance is one of the
> important concept in oops that will support ed by
> java,it will reduce the code length
That's not why we use inheritance.
> but in real world
> programming most of the cases we dont use inheritance
> concepts for user defined classes.
In my real world we use it all the time.
jverda at 2007-7-29 13:50:13 >

I would suggest the OP to review/google for Liskov substitution principle, that might answer some of his questions