关于类和值引用的简单问题
namespace 2007
{
public class Form1 : System.Windows.Forms.Form
{
private DataSet newds = new DataSet();
private void function12()
{
classb bb = new classb()
bb.1 = "123 ";
bb.2 = "321 ";
Thread newt = new thread(newthreadstart(bb.func)
newt.start();
}
private class classb
{
private string 1
private string 2
private func()
{
//我想在这里改动DataSet newds的值,可以吗?怎么做?
}
}
}
}
------解决方案--------------------值类型就是传递一个拷贝,就好像给你一袋大米;引用类型就是传递一个地址,就好像给你一张纸,上面写着大米在厨房,你自己拿
------解决方案--------------------直接操作即可~