Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interfaces also extend

 
Anu
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently, while i was going thru Khalid Mugal, I came to know that Interfaces also extend (ref. to details of Topic "Interfaces"). I was really surprised cos' wht i knew till date was that Interfaces don't extend, they implement. Is that Book correct or I m. Please let me know. And if that happen can anyone explain how does that happen?
Thanx In advance
Anukampa
 
Bharatesh H Kakamari
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Classes implement Interfaces but one interface can extend another interface.

I1 is the super interface. I2 is the sub-interface.
HTH
 
sunilkumar ssuparasmul
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NOT only they extend single interface but also multiple
for eg
interface I1 extends I2,I3 ..{
}
is perfectly legal but u cannot extend class like this
 
Anu
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bharatesh can u please also let me know does interfaces also extend only one class at a time or there can be multiple inheritence in case of interfaces.
Thanx.
Anukampa.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic