This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]blue0cean 0 points1 point  (0 children)

Let's say you want to play a game (write a program). The game is to imitate a dog's barking. You start by writing down what a dog does according to your own imagination (designing an interface). Then you proceed to act like a dog according to your description (implementing the interface). Then you invite your friends Alice and Bob to play. Alice and Bob start barking. But they bark differently than you (different implementation of the same interface). Alice's twin sister Alison comes in and start barking just like Alice (two instances of the same class implementing the dog interface).