Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is int64 in c#?

939


In c#, what will happen if you do not explicitly provide a constructor for a class?

1011


What is interface c#?

915


What is the benefit of interface in c#?

1005


What is the usage of OLE?

1058


How does bitwise work?

940


Why we use methods in c#?

1015


Explain polymorphism in c# with a simple example?

986


Is datetime a value type in c#?

930


how to sort an array in c#

1063


What is the difference between throw and throw ex?

930


What is difference between const and static in c#?

1040


What are the concepts of dispose method?

984


What is datatable and dataset in c#?

1051


can you allow a class to be inherited, but prevent the method from being over-ridden?

1013