as 将对象转换某类型,如果失败则返回null。is用来判断对象是否为某个类型,在判断过程中会对对象进行两次转换,而as只有一次转换,故as效率高。
转载于:https://www.cnblogs.com/jinweijie0527/p/4935741.html
as 将对象转换某类型,如果失败则返回null。is用来判断对象是否为某个类型,在判断过程中会对对象进行两次转换,而as只有一次转换,故as效率高。
转载于:https://www.cnblogs.com/jinweijie0527/p/4935741.html