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
How do I open the console?
What happens if a static constructor throws an exception?
How to sign an assembly with strong name?
What is difference between ilist and list in c#?
Contrast System.String and System.Text.StringBuilder classes?
What is better C# or VB.NET?
What is getenumerator?
What is monitor in C#?
What is addressof operator?
What is a derived class in c#?
What is console application with example?
What is a verbatim string literal and why do we use it?
What is xml c#?
What are the types of assembly available
Explain Constructor and destructor?