public static void Main()
A a = new A(){ PropertyA = "BASE"};
B b = new B(){ PropertyB = "Class B"};
C c = new C(){ PropertyC = "Class C"};
C c1 = new C(){ PropertyC = "Class C"};
B B2 = new B(){ PropertyB = "Class B"};
B c2 = new C(){ PropertyC = "Class C"};
A a3 = new A(){ PropertyA = "BASE"};
A B3 = new B(){ PropertyB = "Class B"};
A c3 = new C(){ PropertyC = "Class C"};
Console.WriteLine("A as B Posible?:" + (aAsB is not null));
var aAsBErrorExecution = (B)a;
Console.WriteLine("A as B Posible?:" + (aAsBErrorExecution is not null));
catch(InvalidCastException)
Console.WriteLine("EXCEPTION: A as B Posible?:NO");
Console.WriteLine("A as C Posible?:" + (aAsC is not null));
Console.WriteLine("B as A Posible?:" + (bAsA is not null));
Console.WriteLine("B as C Posible?:" + (bAsC is not null));
Console.WriteLine("C as A Posible?:" + (cAsA is not null));
Console.WriteLine("B as B Posible?:" + (cAsB is not null));
Console.WriteLine("***************");
Console.WriteLine("B in C Posible?:" + (bInA is B));
Console.WriteLine("C in A Posible?:" + (CInA is C));
public static A MethodAB()
public static A MethodAC()
public static B MethodBC()