C# 'is' operator Clarification

前端 未结 6 1944
半阙折子戏
半阙折子戏 2021-01-17 21:11

Does the is operator indicate whether or not an object is an instance of a certain class, or only if it can be casted to that

6条回答
  •  难免孤独
    2021-01-17 21:30

    From MSDN:

    An is expression evaluates to true if [...] expression can be cast to type

提交回复
热议问题