as 操作符和强行转换的区别

as 操作符和强行转换

System.Object  o  = new ….;

Student  s  = (Student) o; //转换失败会抛出InvalidCastException

Student  s =  o as Student();// 转换失败,snull

原文地址:https://www.cnblogs.com/caoshenghe/p/1574034.html