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
Update current website backend (asp.NET) and build Rest API to expose data I will shortly shape an HTML5 cross-platform mobile app. I at present have a website with a backend th

I need CloudFlare API interface to C# Project Description: We require a small piece of C# .NET code, integrated in an object, that will interface with CloudFlare's API and ge

Improve an existing web application and design (ASP C# Azure Project Description: I want an experience programmer to take my Proof of Concept web app to a professional level.

Project Description: Take a CSV of Canadian street addresses. For every address, translate the address into a GPS coordinate. Use the GPS coordinate to test whether or not the a

What is ReaderWriter Locks? You may want to lock the resource only whenever data is being written and permit multiple clients to parallel read data when data is not being updat

What is the purpose of DOTNET? Dot Net Is a collection of products like C#, ASp.Net, Vb.Net, XML. The purpose of .Net is that we can simply upgrade and degrade our programs whi

write a program in C# to perform arithmetic operation

Explain why your project needed XML. Remember XML was meant to exchange data between the two entities as you can define your user friendly tags with ease. In the real world sce

ASP .NET MVC Tutor Project Description: Work with me and assist with troubleshooting lessons, describe in easy to understand terms how to accomplish certain tasks, provide co

What is Language Integrated Query (LINQ)? LINQ is a programming model that is the composition of general-purpose standard query operators that permit you to work with data, reg