1. is  是验证操作对象是不是自己希望的

     运算公式:对象  is  类型

                     返回true:对象是指定类型

                     返回false:对象不是指定类型

2. as 是将对象转换成指定类型

运算公式:对象 as 类型

               转换成功:对象的类型就是指定的类型

               转换失败:返回null

注意: The  "is" and "as" operator must be used with a reference type or nullable type (example:'int' is a non-nullable value type) 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-07-06
  • 2022-02-10
  • 2022-02-12
  • 2022-12-23
  • 2021-07-19
猜你喜欢
  • 2021-10-01
  • 2021-10-09
  • 2022-01-14
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案