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
Project Description: We are a small development house in Singapore, and have a project which is 90 percent complete; thud our previous developer could not finish due to other co

Among the items that are related to the implementation of an application for automation of processes, are shown as follows: a) The online patient registry through which patients

Why The JavaScript Validation Not Run on the Asp.Net? The Asp.Net Button Is post backed on the server & not yet Submit & when It goes to the server its states is lost so if we

Can you give a practical implementation of FAÇADE patterns? The Façade pattern sits on the top of lot of the subsystems & makes access easy to interfaces of these subsystems. T

Question: (a) Write extract codes to show the structure of the Global.asax file. (b) Outline four classes that allow you to work with File Streams. (c) When working with

Develop PC Cleaner Software Project Description: We are seeking experienced developer who can develop Registry Cleaner / PC Cleaner software for us. Software should be like c

What are the different types of literals? A literal is a textual representation of an exacting value of a type. The dissimilar types of literals in Visual Basic are: Boo

What are major difference between classic ADO and ADO.NET ? Some major differences between the classic ADO & ADO.NET are as follows: 1) As in the classic ADO we had server a

Project Description: System is used for tracking company's activities through several projects by keeping track of incomes and expenses per project. This project is fairly ea

Want C# Single User Login per session Project Description: I need to save simulatenious logins for one account such as one user has a spottily premium account and someone tri