Exemple #1
0
        public void ShowChildExampleDeclaredAsParent()
        {
            MethodOverloading.Parent typeParent = new MethodOverloading.Child();
            MethodOverloading.Child  typeChild  = (MethodOverloading.Child)typeParent;


            System.Diagnostics.Debug.WriteLine("Variable type parent");
            System.Diagnostics.Debug.WriteLine(typeParent.FormatMessage("Hello World"));


            System.Diagnostics.Debug.WriteLine("");
            System.Diagnostics.Debug.WriteLine("Variable type child");
            System.Diagnostics.Debug.WriteLine(typeChild.FormatMessage("Hello World"));
        }
Exemple #2
0
        public void ShowChildExample()
        {
            var child = new MethodOverloading.Child();

            System.Diagnostics.Debug.WriteLine(child.FormatMessage("Hello World"));
        }