interface a
{
Method1()
Method2()
}
class b: a
{
override Method1()
override Method2()
}
what will happen & why?
Answer Posted / nithya
It will through the error because
in interface,the methods should have return type for them.
And we can create only implementation for the methods
available in interface. We cannt override it.
And Virtual/Abstarct or not a valid items in interface.
We must implement the methods available in interface.
interface a
{
void Method1();
void Method2();
}
class b: a
{
public void Method1();
public void Method2();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is stringbuilder c#?
Can You Prevent Your Class From Being Inherited By Another Class?
Do loops c#?
Is unboxing an implicit conversion?
Explain About Web.config
What is difference between for and foreach in c#?
Do loops in c#?
What is strong name assembly?
What are the 3 different types of arrays?
Can property be private in c#?
What is generic and non generic collections in c#?
What is the advantage of constructor in c#?
Why is c# better than java?
What is connection pooling in ado.net?
What do you mean by default constructor?