
using System;
class MYTestX
{
class CT
{
}
class CO
{
public CT ott; //默认是null
public string strx;//默认也是null,而不是空串""
public virtual void Test()
{
Console.WriteLine("co-testJ");
}
}
static void Main(string[] args)
{
CO oo = new CO();
CO ot = null; Console.WriteLine(oo.strx + "ttt");
Console.WriteLine(null + "ttt"); //null可以与字符串连接,不会出现异常
}
}