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 |
localization using windows c#
Distinguish between the Debug class and Trace class with its functionality?
How many bytes is an int in c#?
What is the difference between a variable and a literal?
In .NET how can you solve the DLL Hell problem?
What is unmannaged code and will CLR handle this kind of code or not .
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?
Is it possible to force garbage collector to run?
Will the following code compile?
Explain how to implement an object pool in c#.net
How do you sort a list in c#?
public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?