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

Answers were Sorted based on User's Feedback



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

Answer / maruthi

interface name . function name

Is This Answer Correct ?    10 Yes 1 No

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

Answer / 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

More C Sharp Interview Questions

Explain the Different types of configuration files in .net?

0 Answers  


Advantages of c# over vb.net?

3 Answers   HCL, Syntel,


What is a multi line comment?

0 Answers  


i have a question which is quite simple but yet complicated for me my question is why do we use void, if it does not return anything to the compiler? if it is used for normal display it can also be done by what is called Console.Write() or Consol.WriteLine() and if i do not use void with my method then my compiler throws me an error. if i return a value say integer then i write public int fun() display of the result can also be done here then why is it so necessary to use void with a function and why so compiler throw us an error if v don't use void return type?

2 Answers  


What is static variable in c#?

0 Answers  






Explain the three test cases in unit testing?

0 Answers   Siebel,


Why c# is called c sharp?

0 Answers  


What is Named parameter in C#?

0 Answers  


How can you read 3rd line from a text file?

0 Answers  


Which of the following API is used to hide a window?

0 Answers   3i Infotech,


Give examples for reference types?

0 Answers  


What is the use of "default" and "Using" keyword?

3 Answers   TCS,


Categories