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

What is difference between assembly and dll?

477


What is uint16?

497


Explain what is copy constructor?

549


Why is c# good for games?

522


How do you prevent a class from being inherited in c#?

450






What is the difference between readkey and readline in c#?

452


What is a string in c#?

477


Why do we need to serialize data?

498


Why do we need static in c#?

507


What is a dimensional array?

462


What is inheritance in csharp?

517


What is serialization in unity?

493


Wht executescaler method is used?

530


What is the difference between c and c sharp?

542


What is a nullreferenceexception?

555