C# 显示转换与隐式转换_记录

 public static explicit operator Int32(A a)
{
return a.k;
}
//隐试转换
public static implicit operator A(Int32 i)
{
return new A() { k = i };
}

 

posted @ 2011-11-09 10:58  天空海阔  阅读(200)  评论(0编辑  收藏  举报