.net - Class and Interface in C# -
.net - Class and Interface in C# -
i have interface named imyinterface
contains 4 methods method1
,method2
,method3
,method4
, having 2 classes named base class
, derived class
, have implement method1
,method2
in base of operations class , method3
,method4
in derived class.
how possible can 1 help me
it's pretty simple, should declare base of operations class abstract , mark method3 , method4 abstract in , implement them in derived class. here's sample implementation:
interface imyinterface { void method1(); void method2(); void method3(); void method4(); } abstract class baseclass : imyinterface { public void method1() { } public void method2() { } public abstract void method3(); public abstract void method4(); } class derivedclass : baseclass { public override void method3() { } public override void method4() { } }
c# .net
Comments
Post a Comment