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
How do you create partial methods?
What is class sortedlist underneath?
How long does a loop recorder procedure take?
What is Asynchronous call and how it can be implemented using delegates?
What is the default value of boolean variable?
1. Describe page life cycle?
What is serialization in dot net?
What is helper method in c#?
Which is better interface or abstract class in c#?
Explain the Different types of configuration files in .net?
How does bitwise xor work?
What is the difference between method parameters and method arguments. Give an example?
What are the basics of c#?
What is the CTS, and how does it relate to the CLS?
What is namespace explain with example?