interface G1 { // method declaration void mymethod();}interface G2 { // method declaration void mymethod();} // Geeks implements both // G1 and G2 interfaceclass Geeks : G1, G2{ // Here mymethod belongs to // G1 interfacevoid G1.mymethod(){ Console.WriteLine("GeeksforGeeks");}// Here mymethod belongs to // G2 interfacevoid G2.mymethod(){ Console.WriteLine("GeeksforGeeks");}}
interface G1 {
// method declaration
void mymethod();
}
interface G2 {
// Geeks implements both
// G1 and G2 interface
class Geeks : G1, G2
{
// Here mymethod belongs to
// G1 interface
void G1.mymethod()
Console.WriteLine("GeeksforGeeks");
// G2 interface
void G2.mymethod()
To show what happens to the possible conflicts if you implement multiple interfaces: there are no conflicts.
If multiple interfaces have the exact same method, you merely have to implement it.
If multiple interfaces have similar methods, you must implement them all.There's still no conflict.
Hi ,
Same Method in Both the Interface u just Impliment the One Interface that it.ok i will give with examples later.ok bye
We have two Interface A and B both have one method common in them i.e. GetCustomer(), Suppose if Class C will implement both the interfaces than what will be the implications of Common Method on it.