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 c# most used for?

985


Explain the difference between “as” and “is” operators used in c#?

970


What is typeof undefined?

926


What is lambda expression in c#?

967


What is an escape sequence in c#?

986


Explain About namespaces

991


What is a custom attribute?

904


If a method's return type is void, can you use a return keyword in the method?

895


What is difference between method overriding and method overloading?

1065


Why do we overload constructors?

908


Can you inherit multiple abstract classes in c#?

940


What is the difference between a class and an object c#?

991


What are verbatim strings in c#?

920


What is access specifier in c#?

1070


What are callback methods in c#?

933