Interface Class
interface InterfaceA
{
string MethodA(string s);
}
Abstract Class
public class AbstractB:InterfaceA
{
public string MethodA(string s)
{
return s;
}
}
Object Creation Using Abstract
AbstractB abstractB = new AbstractB();
abstractB.MethodA("Abstract object");
Output : Abstract object
Object Creation Using Interface
InterfaceA interfaceA = new AbstractB();
interfaceA.MethodA("Interface object");
Output : Interface object
Note (Object Creation Using Interface) :
Inheriting the interface directly in the Class and creating the object




