In order to save time for more friends who are still learning, just like me, here is an ugly show. If you are a master, please provide guidance and do not combat the enthusiasm of cainiao.
The Code contains detailed annotations, so the code is directly written.
Using System;
Using System. Collections;
Using System. Configuration;
Using System. Data;
Using System. Linq;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. HtmlControls;
Using System. Web. UI. WebControls;
Using System. Web. UI. WebControls. WebParts;
Using System. Xml. Linq;
Namespace WebApplication3
{
/// <Summary>
/// Class a intentionally defines two fields
/// </Summary>
Public class
{
Public string itema1 {get; set ;}
Public string itema2 {get; set ;}
Public string PrintItem ()
{
Return itema1 + itema2;
}
}
/// <Summary>
/// Class B intentionally defines one field, plus three fields inherited from Class.
/// </Summary>
Public class B:
{
Public string itemb1 {get; set ;}
Public string PrintItemb ()
{
Return itema1 + itema2 + itemb1;
}
}
Public partial class WebForm1: System. Web. UI. Page
{
Protected void Page_Load (object sender, EventArgs e)
{
// Next, let's test and instantiate Class a and Class B and assign them to different values.
A aa =