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 c# most used for?
Explain the difference between “as” and “is” operators used in c#?
What is typeof undefined?
What is lambda expression in c#?
What is an escape sequence in c#?
Explain About namespaces
What is a custom attribute?
If a method's return type is void, can you use a return keyword in the method?
What is difference between method overriding and method overloading?
Why do we overload constructors?
Can you inherit multiple abstract classes in c#?
What is the difference between a class and an object c#?
What are verbatim strings in c#?
What is access specifier in c#?
What are callback methods in c#?