• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Real Usage of overidding and inheritance

 
Varadhan Sesharaman
Ranch Hand
Posts: 30
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10509
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic