Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Real Usage of overidding and inheritance

 
Varadhan Sesharaman
Ranch Hand
Posts: 30
Eclipse IDE Java
  • 0
  • 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: 9472
50
Eclipse IDE Hibernate Ubuntu
  • 0
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic