Team,
As I know that we can't create instance for Interface in .Net
But, I m bit confuse with some scenario's like,
Interface IA
{
add();
}
Class A : IA
{
add()
{
}
}
Now,I can use
IA obj = new A()
Can you please explain briefly & give some reference links to understand with core.
Thanks


Ranjit PowarRank #553 · 4.4K reputationPosted Mar 25, 2014, 9:00 AM EDT
interface I1
{
void add();
}
class Program:I1
{
public void add()
{
Console.Write("Hi");
}
static void Main(string[] args)
{
I1 i = new Program();
i.add();
}
}
VulpesRank #55 · 29.2K reputationPosted Mar 25, 2014, 9:06 AM EDT
http://msdn.microsoft.com/en-us/library/ms173156.aspx
SIVARank #2,303 · 613 reputationPosted Mar 26, 2014, 2:20 AM EDT
SIVARank #2,303 · 613 reputationPosted Mar 26, 2014, 2:21 AM EDT