Monday, 5 February 2018

interface IA
{
    public int showDetails(int a, int b);
}

class A : IA
{
    public int showDetails(int a, int b)
   {
       return (a+b);
   }
}

So, if i removed IA from class A : IA

Shall the code will be executed?

Yes, the code will be executed. but still not implemented interface so, any other way that gives compile time error that you interface implementation is missing.

int IA.showDetails(int a, int b)
{
  return (a+b);
}

No comments:

Post a Comment