Interface, DOT NET Programming

Assignment Help:

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


Related Discussions:- Interface

Explain nutritional properties of processing food, Nutritional properties o...

Nutritional properties of Processing food Processing food, you may have realized that many desirable changes occur, which include development of pleasing colours and flavors, i

Need experienced outlook developer, Need Experienced Outlook (Microsoft Off...

Need Experienced Outlook (Microsoft Office) developer Your required skills: (1) A developer at heart, one that knows how to prepare modular, well-designed and clean code, (2) va

Use of attribute, What is the use of attribute  ? This attribute wo...

What is the use of attribute  ? This attribute works as a compatibility option. We know that ASP worked in STA model and ASP.NET works in MTA model, but what if your ASP.NET

What is cts and cls, What is CTS and CLS? => CLS stands for common lang...

What is CTS and CLS? => CLS stands for common language specification where as CTS stands for common type system. => CLS : cls is a standard for .net . cls is small set of sp

What are attributes, What are Attributes?  Attributes are declarative t...

What are Attributes?  Attributes are declarative tags in code that insert additional metadata into an assembly. There exist two types of attributes in the .NET Framework: Prede

Best practice while implement globalization & localization, What are the be...

What are the best practices while implementing globalization and localization? The best methods while developing international language support software are shown below:- 1)

Define dataset object, How can you identify whether or not any changes are ...

How can you identify whether or not any changes are made to the DataSet object as it was last loaded? The DataSet object provides the following two methods to track down the ch

Explain how validation controls are used to validate forms, Question: (...

Question: (a) List the two main advantages of developing a Multitiered Web Applications. (b) Explain how Validation controls are used to validate forms. (c) Using com

Describe the architecture of the .net framework, Question: (a) What is...

Question: (a) What is VB.NET 2005 and explain the versions of VB.NET. Name the four different types of applications that new version of VB.NET can create. (b) Using the

Tfs - spirateam synchronization plug-in, We would like you to develop the s...

We would like you to develop the subsequent requirements in one plug-in already in production. The plug-in was developed in Visual Studio 2010 .NET Framework 4 C# and synchronizes

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd