An interface is a contract. It says that any objects that implement that interface will provide methods with the signatures described in the interface. It does not say anything at all about HOW the methods will be implemented.
Now, an object "instance" is... an actual instance of an object that has been created. It's an actual reference to something that exists in memory and has an address associated with it. If the object instance is an instance of a particular interface, then you are guaranteed that the object will provide the methods described in the interface "contract".
As an example: the interface for a car guarantees that you're going to have a steering wheel, turn blinkers, gas pedal, brake. Any actual car you get in will have those. (We don't deal with automatic vs standard transmission or experimental thought controlled prototypes.) So, regardless of what car you get from the rental place, you as the client can be assured that the actual car instance you rent will conform to the car "interface" and you'll know how to drive it and that it will take you from point A to point B. So, unless you're the picky sort, you can call up Hertz and say, I need a car for Friday... no, I don't care what kind.
Main Topics
Browse All Topics





by: CrahuigPosted on 2008-09-03 at 21:19:41ID: 22384274
An Instance of an Object is a particular, concrete version of a class that is currently loaded into memory.
An Objects Interface is one of two things as you have phrased it.
1. The methods and fields of an object that are used to manipulate said object.
2. There is a type of object common to many popular programming languages(C#, Java, and many more), known as an Interface. It has several unique characterstics compared to other types of classes / objects which are common across many languages. (Interfaces may only contain abstract class and constants.)