摘要: 类型转换不限于单一继承链中的类型(派生类转换为基类或者基类转换为派生类),完全不相关的类型之间也能进行转换。关键在于在两个类型之间提供转型操作符。在下面这样的情况下应该定义显式转型操作符:在转型有可能失败时,开发者应该定义显式转型操作符。,例如:从long转换为int,这样可以提醒别人只有在确信... 阅读全文
posted @ 2015-03-12 21:00 北风Z 阅读(551) 评论(0) 推荐(0) 编辑
摘要: const 常量字段使用方法 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace Project5_42{ class Program { static void Main(stri... 阅读全文
posted @ 2015-03-12 20:27 北风Z 阅读(1724) 评论(0) 推荐(0) 编辑