Skip to content

Instantly share code, notes, and snippets.

@poojarsn
Created August 16, 2021 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poojarsn/7151cd64ebfc0a8e15a632d3f5711fbb to your computer and use it in GitHub Desktop.
Save poojarsn/7151cd64ebfc0a8e15a632d3f5711fbb to your computer and use it in GitHub Desktop.
Two interfaces with same method
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
I1 ia = new C();
ia.Method1();
I2 ib = new C();
ib.Method1();
}
public class C: I1, I2
{
void I1.Method1()
{
Console.WriteLine("Hello");
}
void I2.Method1()
{
Console.WriteLine("Bye");
}
}
public interface I1
{
void Method1();
}
public interface I2
{
void Method1();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment