New Message on dotNET User Group Hyd

Interface is an Reference Type or Value Type

Reply
  Reply to Sender   Recommend Message 2 in Discussion
From: AlwaysLakshmi

Hi Saurabh,
 
Interfaces are reference types.Throughout the .NET framework, interfaces are used to define that certain types have well-known behaviors. For example, the ICloneable interface specifies that a .NET type can be cloned and defines a specific programming signature for how cloning is performed. In this way, an interface both advertises a specific functionality or behavior for a .NET type and also defines the method/property signature for the behavior.
In .NET, an object can be derived from a single ancestor, yet implement any number of interfaces. There is no problem with multiple interfaces defining a common method; the object being defined would only implement the common method once. This is the difference between interfaces and inheritance.
 
There are several other interfaces woven into the .NET framework that simplify embedding your custom classes into the .NET framework.
*IComparable is used to ensure that your class is sortable.
*IClonable is used to ensure that your class can be cloned. Cloning simply creates another instance of the class -- a duplicate of the original.
*IFormattable is used to change the behavior when a user of your class invokes the ToString method.
*IDisposable is used to provide functionality to release any unmanaged resources, such as COM objects, that your class may be using.
Properly using these interfaces will make classes that you write integrate more tightly with the .NET framework, which will make them behave more predictably when someone tries to use them. Not only can you implement these and other predefined interfaces, you can also define custom interfaces to use in your design.
 
You can also check how IComparable interface is used in .net as shown below:
HTH
Regards
Lakshmi

View other groups in this category.

Click Here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to