To help clarify a bit what people mean by "adhering to the contract" - it refers to guarantees the type spec makes, that people using it can rely on. Suppose the type in question is a collection of some sort where you can specify a maximum number of elements that cannot change during the lifetime of an object - and that this is stated explicitly about the type. There may be a default constructor, establishing a default value, there might be a constructor that lets you specify a value, and there may be subclasses that have a different default value, or that calculate it in some way. 1/2
↧