Exemplo n.º 1
0
        //Main_2_6_2
        public static void Main_2_6_2()
        {
            DoSomething(new SonClass());
            SonClass son = new SonClass();
            FatherClass father = son is FatherClass ? (FatherClass)son : null;
            father.Method();

            FatherClass f2 = new FatherClass();
            SonClass son2 = f2 is SonClass ? (SonClass)f2 : null;
            son2.Method();
        }
Exemplo n.º 2
0
        public static void Main_2_6_2()//Main_2_6_2
        {
            DoSomething(new SonClass());
            SonClass    son    = new SonClass();
            FatherClass father = son is FatherClass ? (FatherClass)son : null;

            father.Method();

            FatherClass f2   = new FatherClass();
            SonClass    son2 = f2 is SonClass ? (SonClass)f2 : null;

            son2.Method();
        }