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

Is c# easier than c++?

0 Answers  


What is private readonly in c#?

0 Answers  


Can we inherit a private class in c#?

0 Answers  


What is the use of parse in c#?

0 Answers  


Can you declare the override method static while the original method is non-static?

3 Answers  


Why is it not a good idea to use empty destructors?

0 Answers  


1)what is timestamp in C# (anilringole@gmail.com)

2 Answers   Wipro,


How do you type a null character?

0 Answers  


What is a nested type. Give an example?

0 Answers  


What namespace is list in c#?

0 Answers  


what is garbage collection?

8 Answers   Protech,


Are c# strings null terminated?

0 Answers  


Categories