aspose file tools*
The moose likes Beginning Java and the fly likes Real Usage of overidding and inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Real Usage of overidding and inheritance" Watch "Real Usage of overidding and inheritance" New topic
Author

Real Usage of overidding and inheritance

Varadhan Sesharaman
Ranch Hand

Joined: Apr 21, 2011
Posts: 30

Guys,

I had good idea on what is overridding and inheritance but actuaaly need to know why we need them and when to use them?

Explain them with a eg if possible.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7831
    
  21

Varadhan Sesharaman wrote:I had good idea on what is overridding and inheritance but actuaaly need to know why we need them and when to use them?

It's basically to allow subtyping; but this is such a fundamental part of Object-Oriented programming that I think you should really read the tutorials rather than relying on our interpretation. You might also want to Google "polymorphism".

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
jQuery in Action, 2nd edition
 
subject: Real Usage of overidding and inheritance