Hi,
Can we implement the Abstract class on interface in c#, If
yes then provide the code implementation
Answer Posted / 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 View All Answers
Define property in c#.net?
How to achieve polymorphism in c#?
Define multicast delegate? How it be used?
What is immutable in C#?
What is the difference between constants and read-only?
What is the benefit of dependency injection c#?
Why c# is called type safe language?
Can a private virtual method can be overridden?
If you want to write your own dot net language, what steps you will u take care?
Explain the process of abstraction with an example?
What does xpath return?
What is signature c#?
How do you implement thread synchronization in c#?
What is scope c#?
What is new method in c#?