as 操作符和强行转换

System.Object  o  = new ….;

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

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

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2022-01-14
  • 2021-11-18
  • 2021-08-08
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案