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 / sowmya

no we can't

using System;
interface abs
{
void display();
}
abstract class abs1:abs
{
public abstract void read();
}
class ba:abs1
{
int a;
public override void read()
{
Console.WriteLine("enter any value");
a=Convert.ToInt32(Console.ReadLine());
}
public void display()
{
Console.WriteLine(" Ur entered value:{0}",a);
}
}
class main
{
public static void Main()
{
ba b=new ba();
b.read();
b.display();
}
}
error CS0535: 'abs1' does not implement interface member
'abs.display()'

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1036


What is an event in c#?

901


Explain the types of comments in c#?

921


Can we have multiple constructors in a class c#?

931


What do you mean by jagged array?

925


what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?

1901


What is the difference between interface and inheritance in c#?

915


What is an int in c#?

920


Can class be protected in c#?

939


What is Implementation inheritance and interface inheritance?

1021


Can namespace contain the private class?

945


How can it prevents DLL Hell assembly versioning in .NET?

1029


How long does it take to learn c# for unity?

919


What is a helper method in c#?

943


What are predicates in c#?

952