Ejemplo n.º 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"));
        }
Ejemplo n.º 2
0
        public void ShowChildAppendExample()
        {
            var child = new MethodOverloading.Child();

            System.Diagnostics.Debug.WriteLine(child.AppendAndFormat("Hello World", "!"));
        }
Ejemplo n.º 3
0
        public void ShowChildExample()
        {
            var child = new MethodOverloading.Child();

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