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 is Six Sigma implementation? To attain Six Sigma is a team effort and cannot be attained individually. Driving the Six Sigma itself in an organization is vast project as i

What are queues and stacks? Stacks refer to a list in which all items are accessed and processed on the Last-In-First-Out (LIFO) basis. In a stack, elements are inserted (push

i am working on an project and my client needs it in 2 days.project is ready but don''t know how to make setup project including local sql database(.mdf) included in setup..

What is the difference between Server.Transfer and response.Redirect? The difference  between the Server.Transfer and the response.Redirect them are as follows:- 1)Response.

Project Description: Someone to review all our IT systems / dfs replication / set up/ backups etc and give a report. Skills required: SQL, Microsoft Exchange, Windows Serv

What do you understand by SOAP encoding? The Serialization of the types, such as integers and strings, inside a SOAP message is known as encoding. The SOAP objects use XML elem

Implement the service architecture using both .NET and Java technologies based on the following minimum requirements for this assessment. a.  The 'Parcel transaction service' mu

I need Beautiful Chatting Application Project Description: I need a beautiful chatting application created that has both private as well as public chat system. The chatting c

The Cache object is always defined in the System.Web.Caching namespace. You can get the reference to the Cache object by either using the Cache property of the HttpContext class in

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