Hi All,
Just curious about how .NET CLR handles interfaces internally?
Q1] What happens when CLR encounters something like :
simple interface example. (same used below.)
interface ISampleInterface
{
void SampleMethod();
}
class ImplementationClass : ISampleInterface
{
// Explicit interface member implementation:
public void SampleMethod()
{
// Method implementation.
}
static void Main()
{
//Declare an interface instance.
ISampleInterface mySampleIntobj = new ImplementationClass(); // (A)
// Call the member.
mySampleIntobj.SampleMethod();
// Declare an interface instance.
ImplementationClass myClassObj = new ImplementationClass(); // (B)
//Call the member.
myClassObj.SampleMethod();
}
}
Q2 : In the above example how are (A) and (B) differentiated ?
Q3 : Are Generic Interfaces treated differently?
(Feel like a noob when asking basic questions like these ...anyways....)
Thx all.