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 is the default value of decimal in c#?

0 Answers  


Does the variables of a private class-level inherited?

0 Answers   Siebel,


What is the use of giving more than one CATCH BLOCK in one TRY block? Directly we can give that catch(Exception e)?Why we go for arrayoutofbound Exception,divided by zero etc..? Explain

2 Answers  


What is strong name in c# and how can we use it?

0 Answers   DELL,


What is COM Interoperability?

0 Answers   DELL,






Write a program to find the angle between the hours and minutes in a clock

0 Answers  


Give an example of a ctype.

0 Answers  


What is the difference between field and variable in c#?

0 Answers  


7. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

2 Answers  


Difference between directcast and ctype.

0 Answers  


What is difference between hashtable and dictionary in c#?

0 Answers  


What are the Types of assemblies that can be created in dotnet

0 Answers  


Categories