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


Please Help Members By Posting Answers For Below Questions

How do I open the console?

607


What happens if a static constructor throws an exception?

492


How to sign an assembly with strong name?

581


What is difference between ilist and list in c#?

483


Contrast System.String and System.Text.StringBuilder classes?

524






What is better C# or VB.NET?

531


What is getenumerator?

459


What is monitor in C#?

593


What is addressof operator?

522


What is a derived class in c#?

474


What is console application with example?

498


What is a verbatim string literal and why do we use it?

477


What is xml c#?

485


What are the types of assembly available

512


Explain Constructor and destructor?

527