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


Please Help Members By Posting Answers For Below Questions

Is datetime value type c#?

477


Is c# the same as d flat?

496


Is everything an object c#?

487


What are the various components in crystal reports?

496


What operators can be used to cast from one reference type to another without the risk of throwing an exception?

510






Differentiate between method overriding from method overloading with its functionality?

531


How can you set image source dynamically from c# application to ”test.png” file?

633


how to sort an array in c#

558


What are the 2 broad classifications of data types available in c#?

460


What is a deadlock lock?

485


What is namespace give the example?

456


Why is c# used?

476


Is system a class in c#?

479


What is xor operation?

521


How do you create dlls in .NET

566