Interface, DOT NET Programming

What is a Interface?

The Interface is a contract that describes the signature of the functionality. So when a class is implementing a interface it says to the outer world, that it provides specific behavior. For example if a class is implementing Idisposable interface which means it has a functionality to release unmanaged resources. Now all the external objects using this class know that it has contract by which it can dispose unused unmanaged objects.

1.     The Single Class can implement multiple interfaces.

2.     If a class implements the interface then it has to provide implementation to all its methods.

In the sample there are 2 files. One has the definition of interface and other class implements the interface. Below is the source code "IInterface" is the interface and "ClsDosomething" implements the "IInterface". The  sample just displays a simple message box.

Public Interface IInterFace

 Sub DoSomething()

 End Interface

 Public Class ClsDoSomething

Implements IInterFace

 Public Sub DoSomething() Implements WindowsInterFace.IInterFace.DoSomething MsgBox("Interface implemented") End Sub

 End Class

38_Interface.png

Figure:-Interface in action

Posted Date: 9/21/2012 8:49:04 AM | Location : United States







Related Discussions:- Interface, Assignment Help, Ask Question on Interface, Get Answer, Expert's Help, Interface Discussions

Write discussion on Interface
Your posts are moderated
Related Questions
What are the different elements in Functions points? 1) Internal Logical Files (ILF): Following are some points to be noted for ILF:- The ILF are logically related d

I want Text/Image printing Counter Project Description: Need your help in our C# programming project. We need to pass this project in two weeks starting from now to pass our

Question: (a) How do you implement the following in ASP.NET: (i) Server-side Comments (ii) Server-side Include Directives. (b) (i) Give two reasons why the IsPostBack

What is a delegate? A delegate is similar to a class that is used for storing the reference to a method and invoking that method at runtime, as needed. A delegate can hold the

Net project Project Description: We want to make .net project Microsoft Active Directory, PMS Lync 2010 - 2013 databases creating a license key for their SW generati

I need Academic expert for Genetic Algorithm Project Description: Seeking academic expert for Genetic Algorithm. Please bid on this project if you will start work today. S

I am seeking asp.net developers, and will raise depends on skills and work, we are a web development firm in mexico and i want full time developers that can focus 100 percent my pr

Explain Custom Activities. In addition to the standard activities available within the base activity library, you can make new activities to meet exact business needs. Creating

Define the ToolTip control. How can you associate it with other controls? The ToolTip control produces a small pop-up window with explanatory text for an element it is displaye

What is XPath? XPath stands for XML Path. It is a language used to access dissimilar parts of an XML document, such as elements and attributes.