Hi,
Can we implement the Abstract class on interface in c#, If
yes then provide the code implementation



Hi, Can we implement the Abstract class on interface in c#, If yes then provide the code imple..

Answer / rakesh

public interface IService<T>
{
int Add(T entity);
void Update(T entity);
}

public abstract class ServiceBase<T> : IService<T>
{
public int Add(T entity) { ... }
public void Update(T entity) { ... }
}

public interface ICarService : IService<Car>
{
}

public class SomeBaseClass : ServiceBase<Car>, ICarService
{
public int Add(Car entity);
public void Update(Car entity);
}

Is This Answer Correct ?    12 Yes 2 No

Post New Answer

More C Sharp Interview Questions

Difference between debug.write and trace.write?

1 Answers  


Is everything an object c#?

1 Answers  


What is ienumerable t in c#?

1 Answers  


What is string pool in c#?

1 Answers  


What is the difference between mobile application and desktop application?

1 Answers  


Is enum a class c#?

1 Answers  


What does do in c#?

1 Answers  


How do you comment out code in c#?

1 Answers  


How do you secure a webservice?

1 Answers   TCS,


What is an inheritance in c#?

1 Answers  


What is the compiler of c#?

1 Answers  


What is the difference between String s(Small s) and String S(Capital S)?

4 Answers  


Categories