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 can I create with c#?
What is the use of ispostback in c#?
What is the base class in .net from which all the classes are derived from?
What is throw in c#?
What is the difference between a constant and a static readonly field?
Is string nullable c#?
Explain states of a thread in c#?
Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!
What is meant by unicode characters?
What is the difference between dataset and datatable in c#?
Is c# code is unmanaged or managed code?
What are the advantages of properties in c#?
What is the advantage of constructor in c#?
Is an array an object c#?
What is an object and a class?