Saturday 1 October 2011

What is a Interface?


                 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.

No comments:

Post a Comment