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 is the predicate of a sentence?
What is default value of bool in c#?
Can a class be protected in c#?
What is a variable in c#?
Can abstract class be sealed?
Distinguish between the Debug class and Trace class with its functionality?
Suppose two interfaces have same method, so how will you implement these methods in derive class?
What is a private method in c#?
What is tpl in c#?
How to sign an assembly with strong name?
What is the difference between namespace and class in c#?
Which is faster dictionary or hashtable?
How do I format in c#?
Does c# have a 'throws' clause?
How many bytes is an int in c#?