struct Point
{
public int x,y;
public Point(int x, int y)
{
this.x =x;
this.y=y;
}
} public void TestBox()
{
Point P = new Point(10, 10);
Response.Write("P.x=" + P.x + ",P.y=" + P.y );
object O=P;
P.x=20;
O.y= 201;
Response.Write("P.x=" + P.x + ",P.y=" + P.y);
Response.Write("O.x=" + O.x + ",O.y=" + O.y);
Response.End();这里的object O=P后 为什么提示O.y=201;出错了,“object”并不包含“y”的定义
{
public int x,y;
public Point(int x, int y)
{
this.x =x;
this.y=y;
}
} public void TestBox()
{
Point P = new Point(10, 10);
Response.Write("P.x=" + P.x + ",P.y=" + P.y );
object O=P;
P.x=20;
O.y= 201;
Response.Write("P.x=" + P.x + ",P.y=" + P.y);
Response.Write("O.x=" + O.x + ",O.y=" + O.y);
Response.End();这里的object O=P后 为什么提示O.y=201;出错了,“object”并不包含“y”的定义
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货