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

What are value types and reference types?

0 Answers  


public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?

8 Answers  


Which of the following operations can you not perform on an ado.net dataset?

0 Answers  


What does the keyword virtual mean in the method definition?

1 Answers  


What is different about switch statements in c#?

0 Answers  






Explain the OOPS concept in C#?

0 Answers   HCL,


What is the example of predicate?

0 Answers  


What are the return types in c#?

0 Answers  


What is the difference between hashtable and dictionary?

0 Answers  


What r collections c sharp?

3 Answers  


What is default access modifier for class in c#?

0 Answers  


What is strong name assembly?

0 Answers  


Categories