Created
June 5, 2012 21:53
-
-
Save c1982/2878287 to your computer and use it in GitHub Desktop.
Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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