Example #1
0
        private void btnOverloadStr1_Click(object sender, EventArgs e)
        {
            string x;

            x = tbEnterFirst.Text;

            Method_Overloading mo = new Method_Overloading();

            // Add method here takes one string parameter
            mo.Add(x);
        }
Example #2
0
        private void btnOverloadInt1_Click(object sender, EventArgs e)
        {
            int a;

            //  int a holds the input of tbEnterFirst
            int.TryParse(tbEnterFirst.Text, out a);

            // Creating an instance of Method_Overloading class
            Method_Overloading mo = new Method_Overloading();

            // Calling Add method that has one parameter
            mo.Add(a);
        }