private void button1_Click(object sender, EventArgs e) { mySecondClass mc = new mySecondClass(); myThirdClass mtc = new myThirdClass(); mtc.Test = "10";// inherites from all classed as dirived. }
private void button1_Click(object sender, EventArgs e) { mySecondClass mc = new mySecondClass(); MessageBox.Show(mc.age.ToString()); //member of myclass. MessageBox.Show(mc.hairColor); // member of second class. MessageBox.Show(mc.Name); //protected can't access. }
private void button1_Click(object sender, EventArgs e) { //myClass mc = new myClass();//abstract blocks creation. //mc. prevent users from createing instance. MyClass.Age = 10; mySecondClass test = new mySecondClass(); test.showMessage("Hello World!"); }