What is interface? step by step procedure to use interface .
what is interface? step by step procedure to use interface in asp.net using c#
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shambhu55 reputationPosted Dec 14, 2012, 1:54 AM EST
An interface contains only the signatures of methods, delegates or events. It contains only pure virtual methods which required to implement in the derived class that implements the interface.
Interfaces in C # provide a way to achieve runtime polymorphism.
public interface IPayment
{
void MakePayment(string a, int b=0);
}
public class PayPay : IPayment
{
public void MakePayment(string a); // it needs only one parameter
}
public class Google : IPayment
{
public void MakePayment(string a, int b); // it needs two parameters.
}
Interface can be implemented implecitly or explicitly
http://blogs.msdn.com/b/mhop/archive/2006/12/12/implicit-and-explicit-interface-implementations.aspx