Saturday, October 20, 2007

Common Interfaces

The following are some common interfaces implemented by user-defined types:

IComparable: This is required for sorting.

IDisposable: This is used for manually disposing an object

IConvertible: This provides conversion to a base type

ICloneable: This is to provide a copy for an object

IEquatable: This is used when comparison of objects using "==" is required

IFormattable: This is used to convert an object into a formatted string (rather than use the base ToString method)

No comments: