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
What are cookies in c#?
Explain clr in brief.
What is the difference between finalize() and dispose()?
Why we use get and set property in c#?
How do you type a null character?
What is a multicast delegate in c#?
Is datetime a value type in c#?
Why is it called c sharp?
How do you inherit a class into other class in c#?
what are the Disadvantages of vb
Why do we use void in c#?
What is console writeline in c#?
What is gac? What are the steps to create an assembly and add it to the gac?
What is a nested type. Give an example?
What is use of singleton class in c#?