Can we inherit an interface in an abstract class?
Answer Posted / arne
yes you can. The example from anwser #4 is incorrect.
using System;
public interface IDisplay
{
void Display();
}
public abstract class MyClass : IDisplay
{
public MyClas(){};
public abstract DoSomething();
public void Display() {};
}
This code compiles fine without a problem. Abstract classes can inherit from interfaces as an abstract class defines the the functionality and restrictions for subclasses.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is int64 in c#?
In c#, what will happen if you do not explicitly provide a constructor for a class?
What is interface c#?
What is the benefit of interface in c#?
What is the usage of OLE?
How does bitwise work?
Why we use methods in c#?
Explain polymorphism in c# with a simple example?
Is datetime a value type in c#?
how to sort an array in c#
What is the difference between throw and throw ex?
What is difference between const and static in c#?
What are the concepts of dispose method?
What is datatable and dataset in c#?
can you allow a class to be inherited, but prevent the method from being over-ridden?