Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on what is an interface within the C# forums, part of the Software Development category; what is interface in c#?...
|
|||||||
|
|||
|
Re: what is an interface
Hi Prakashraj,
An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface, as shown in the following example: interface ISampleInterface { void SampleMethod(); } class ImplementationClass : ISampleInterface { // Explicit interface member implementation: void ISampleInterface.SampleMethod() { // Method implementation. } static void Main() { // Declare an interface instance. ISampleInterface obj = new ImplementationClass(); // Call the member. obj.SampleMethod(); } } Thanks & Regards, Riju. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interface | mahasang2k | OOPS | 5 | 08-27-2009 03:23 AM |
| Interface has too many methods | Geek_Guest | QTP | 1 | 09-11-2007 09:16 AM |
| API/Interface for implementing MRC | ssriramkumar | SQL | 0 | 05-28-2007 03:41 AM |
| COM interface | JobHelper | QTP | 1 | 03-30-2007 02:07 PM |
| interface..... | psuresh1982 | Java | 1 | 01-08-2007 01:40 PM |