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
How to declare a property in a class?
Explain about Threading Types.
What is predicate builder?
Is string nullable in c#?
What is data type in c# with example?
What are delegates and why are they required?
What is list collection in c#?
How do I type a whitespace character?
If a method's return type is void, can you use a return keyword in the method?
What is equal c#?
Define acid rule of thumb for transactions in c#.
Whats an assembly? Describe the importance of assembly?
What does a constructor do c#?
Can you have an array of arrays?
Is predicate a functional interface?