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

localization using windows c#

2 Answers  


Distinguish between the Debug class and Trace class with its functionality?

0 Answers   Siebel,


How many bytes is an int in c#?

0 Answers  


What is the difference between a variable and a literal?

0 Answers  


In .NET how can you solve the DLL Hell problem?

0 Answers   Siebel,






What is unmannaged code and will CLR handle this kind of code or not .

0 Answers   DELL,


what is default accessibility for a class? what is difference b/w viewstate and controlstate? what is the default access specifier for a top level class which are not nested into other classes?

2 Answers  


Is it possible to force garbage collector to run?

0 Answers  


Will the following code compile?

0 Answers  


Explain how to implement an object pool in c#.net

0 Answers  


How do you sort a list in c#?

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  


Categories