Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interfaces

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic