using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ch7_3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DerivedClass d = new DerivedClass();
            BaseClass c = new BaseClass();
            label1.Text = d.display();
            label1.Text += "\n" + c.display();
            label1.Text += "\n" + d.show();
            label1.Text += "\n" + c.show();
            //polymorphism
            c = d;
            label1.Text += "\nPolymorphism :" + c.show();
            //nonpolymorphism
            label1.Text += "\nNon polymorphism :" + c.display();
        }
    }
}
