This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface inheritace

 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is that true interface doesn't support inheritance?
then what happen when we extends one interface to another
 
Hector Tenedero
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should clear things out
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,i didn't get the answer
is interface support inheritance
tell me "yes or no"
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An interface can extend another interface, and so an interface can inherit method signatures from another interface. So yes, interfaces do support inheritance.
 
Larry Frissell
Ranch Hand
Posts: 82
2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper, I am not sure that I agree, I guess the answer would depend on the meaning of "inheritance". In the Sun tutorial in the discussion of inheritance it states "Object-oriented programming allows classes to inherit commonly used state and behavior from other classes". In the discussions of interfaces they use the term "extends" when they rewrite the interface, but not inherit.

My point is that you can add methods to an interface, but you can not inherit the state or behavior.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic