关于int和int?,赋值null
本帖最后由 zpzhangwenhan 于 2013-01-10 17:00:24 编辑
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Person p = new Person();
p.Age = null;
p.Age2 =null;
}
}
public class Person
{
public int? Age
{
get;
set;
}
public int Age2
{
get;
set;
}
}
}