using System;
public class Program
{
public static void Main()
Console.WriteLine("Hello World");
var obj1 = new Foo();
var obj2 = (iFoo) new Foo();
DoSomething(obj1);
DoSomething(obj2);
}
public static void DoSomething(object o)
Console.WriteLine("o.objType: " + o.GetType());
public interface iFoo
int Val{get;set;}
public class Foo : iFoo
public int Val {
get{ return 123;}
set { Val = value;}