一个简直class求解?
ms2e 2006-04-13 11:16:15 class A里包含了class B,但是执行时出错,能不能帮忙改正一下?谢谢。
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
A test = new A();
test.b.data = "USD"; // ERROR
}
}
public class A
{
private B bField;
public B b
{
get { return this.bField ; }
set { this.bField = value; }
}
public A()
{
}
}
public class B
{
private string dataField;
public string data
{
get { return this.dataField; }
set { this.dataField = value; }
}
}
}