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
Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?
What does using system mean in c#?
Why do we use lambda expression in c#?
Which is better python or c#?
What is the purpose of a console table?
Can we inherit abstract class in c#?
Why do we need interfaces in c#?
What are the concepts of dispose method?
What is data binding c#?
What is console application with example?
What is the use of 0 in c#?
What is a method c#?
Explain async and await?
Is c# lazy thread safe?
What are the advantages of generics in c#?