• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class and Interface Relation  RSS feed

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is relationship between class and interface when class implements interface...like there is IS-A relationship when class extends another class.

answers with example will be more explanatory
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a class C implements an interface I then an instance of C is-a I.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example Class Car is a Vehicle.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(If Vehicle is an interface, but it sounds more like a class to me. In any case, I already gave an example.)
 
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!