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 real use of interface in c#,other than that multiple inheritance is not possible
What is meant by clr?
What are the classes contained in a single .NET DLL ?
Define property in c#.net?
Which controls do not have events?
what is scope of a protected internal member variable of a c# class
What is the difference between finalize() and dispose() methods?
List the fundamental oop concepts?
Can u list some style properties of List Box?
What is the difference between abstraction and encapsulation in c#?
What is a thread c#?
What does exclamation mark mean in access query?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)