Hi,
Can we implement the Abstract class on interface in c#, If
yes then provide the code implementation
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 |
What is the default value of decimal in c#?
Does the variables of a private class-level inherited?
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
What is strong name in c# and how can we use it?
What is COM Interoperability?
Write a program to find the angle between the hours and minutes in a clock
Give an example of a ctype.
What is the difference between field and variable in c#?
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?
Difference between directcast and ctype.
What is difference between hashtable and dictionary in c#?
What are the Types of assemblies that can be created in dotnet