level 1
你套呀我
楼主
读程序写出程序结果及得出该结果理由
protected void Page_Load(object sender, EventArgs e)
{
int[] myarray = { 1, 4, 5 };
Response.Write(myarray[0] + "<br/>");
change(myarray);
Response.Write(myarray[0] + "<br/>");
}
public void change(int[] arr)
{
// both of the following changes will affect the original variables:
arr[0] = 888;
arr = new int[5] { -3, -1, -2, -3, -4 };
Response.Write(arr[0] + "<br/>");
}
2011年04月28日 02点04分
1
protected void Page_Load(object sender, EventArgs e)
{
int[] myarray = { 1, 4, 5 };
Response.Write(myarray[0] + "<br/>");
change(myarray);
Response.Write(myarray[0] + "<br/>");
}
public void change(int[] arr)
{
// both of the following changes will affect the original variables:
arr[0] = 888;
arr = new int[5] { -3, -1, -2, -3, -4 };
Response.Write(arr[0] + "<br/>");
}