首页上一页 1 下一页尾页 1 条记录 1/1页
关于包含类型
发表在ASP.NET图书答疑
2009-10-08
是否精华
是
否
版块置顶:
是
否
public partial class _Default : System.Web.UI.Page
{
public class aaa
{
private string val1;
public aaa(string str)
{
val1 =str;
}
public string Val1
{
get { return val1 ; }
set { val1 = value; }
}
}
public class bbb
{
private aaa bval1;
public bbb()
{
}
public aaa Bval1
{
get { return bval1 ; }
set { bval1 = value; }
}
}
protected void Page_Load(object sender, EventArgs e)
{
bbb bb = new bbb();
bb.Bval1 = new aaa("abcd");
Response.Write(bb.Bval1.Val1);
}
}
请求详细讲解一下这两句
bb.Bval1 = new aaa("abcd");
Response.Write(bb.Bval1.Val1);
为什么这么用啊,还有这一句的意思 private aaa bval1;
一直没有把包含类型搞懂
{
public class aaa
{
private string val1;
public aaa(string str)
{
val1 =str;
}
public string Val1
{
get { return val1 ; }
set { val1 = value; }
}
}
public class bbb
{
private aaa bval1;
public bbb()
{
}
public aaa Bval1
{
get { return bval1 ; }
set { bval1 = value; }
}
}
protected void Page_Load(object sender, EventArgs e)
{
bbb bb = new bbb();
bb.Bval1 = new aaa("abcd");
Response.Write(bb.Bval1.Val1);
}
}
请求详细讲解一下这两句
bb.Bval1 = new aaa("abcd");
Response.Write(bb.Bval1.Val1);
为什么这么用啊,还有这一句的意思 private aaa bval1;
一直没有把包含类型搞懂