How to call a function when a class implements 2 interfaces and function is present in both interfaces?

Answer Posted / mahesh babu ummaneni

we have two interfaces inclass thet two interfaces having same method name the time wecan call based on interface

example
interface1
{
add()
}
interface2
{
add()
sub()
}
class classname:interface1,interface2
{
'now wewant call the method add from interface1
interface1.add()
'now we want call the method add from interface2
interface2.add()
'now we want call the method sub() from interface2
interface2.sub()
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does string intern do?

488


What is the signature of a method?

483


What is an array class?

520


Illustrate namespaces in c#?

548


Can abstract class instantiated c#?

500






What is entity framework in c#?

475


What is dao in c#?

488


Why do we use methods in c#?

475


What can we do to handle multiple exceptions?

553


What is console based application?

474


What is token in c#?

528


When can a derived class override a base class member?

523


What is literal in c#?

471


Why do I get a syntax error when trying to declare a variable called checked?

548


Explain the various types of classes used in c#?

499