Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is a Interface
What is a Interface ?
✍: Guest
Interface is a contract that defines the signature of the functionality. So if a class is
implementing a interface it says to the outer world, that it provides specific behavior.
Example if a class is implementing Idisposable interface that means it has a functionality
to release unmanaged resources. Now external objects using this class know that it has
contract by which it can dispose unused unmanaged objects.
ã Single Class can implement multiple interfaces.
ã If a class implements a interface then it has to provide implementation to all
its methods.
In sample there are two files.One has the interface definition and other class implements
the interface. Below is the source code “IInterface” is the interface and “ClsDosomething”
implements the “IInterface”. This 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
2007-10-23, 5614👍, 0💬
Popular Posts:
What is a fish bone diagram ? Dr. Kaoru Ishikawa, invented the fishbone diagram. Therefore, it can b...
Can Sub Procedure/Function Be Called Recursively? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
Where are cookies actually stored on the hard disk? This depends on the user's browser and OS. In th...
How Is the Width a Parent Element Related to Child Elements? - CSS Tutorials - Understanding Multipl...
Managed Code and Unmanaged Code related ASP.NET - How do you hide Public .NET Classes and other publ...