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 static noise?
What is different between Boxing and Unboxing?
Can abstract class instantiated c#?
Can we override main method in c#?
Why is c# good for games?
What is use of private class in c#?
How much time will it take to learn unity?
What is the use of iqueryable in c#?
Give an example of a directcast.
Why do you need boxing in c#?
What is xor operation?
What is generic in c#?
How the versioning applies to Assemblies or can you explain version numbers?
Is int a struct in c#?
Why we use extension methods in c#?