Skip to content

Instantly share code, notes, and snippets.

@c1982
Created June 5, 2012 21:53
Show Gist options
  • Save c1982/2878287 to your computer and use it in GitHub Desktop.
Save c1982/2878287 to your computer and use it in GitHub Desktop.
Interface
namespace ConsoleApplication6
{
using System;
class Program
{
static void Main(string[] args)
{
var a = new MyClass();
var b = a as IA;
var c = b as IB;
b.M1();
c.B1();
}
}
class MyClass : IA, IB
{
public void M1()
{
Console.WriteLine("IA M1");
}
public void B1()
{
Console.WriteLine("IB B1");
}
}
interface IA
{
void M1();
}
interface IB
{
void B1();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment