Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Student foo = new Student("Foo", "Gamla Staden", "G");
            Teacher bar = new Teacher("Bar", "Gamla Staden", 100);

            if (foo is Person)
            {
                //Will be printed
                foo.PrintInfo();
            }
            if (bar is Person)
            {
                //Will be printed
                bar.PrintInfo();
            }
        }