Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Interfaces  RSS feed

 
Fitz Herbert
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A question I need some straight answers for my text books are sending me up the creek!!! Q1 Is an interface inherited? I have no reasoning for interfaces not being inhertited?
Thank you dearly
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fitz,
Welcome to JavaRanch. If a class implements an interface then all subclasses that extend that class inherit the implementation. For example:

One other point here is that a subinterface will inherit all the methods of its superinterface:

So a class that implements BabyFooey must define both someMethod and someOtherMethod or declare itself abstract.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!