I have one specific query with the interfaces.

By default interface methods are abstract and virtual so if we implement that interface and gives definition in the class we actually override that method but when we mark the method as a virtual again in the implementing class why the compiler is not considering that we are actually trying to hide the original interface virtual method.

Like if we have a virtual method in the base class and derived class again marked the method as virtual in that case compiler gives the warning that you are hiding the base class method so use new if you are intentionally hiding the base class method.

public interface ITestInterface
{
    void virtualmethod(); // this method is by default virtual. 
}
public class TestInterface :ITestInterface
{
   public virtual void virtualmethod()
   {
    // Now compiler should consider that i am actually hiding the interface virtual method.
   }
}

if you build the above code for interface and open in ILDASM you will see the code like this:

.method public hidebysig newslot abstract virtual
         instance void virtualmethod() cil managed
{
}//end of method ITestInterface::virtualmethod
Edit
Report