Vivek Kumar
What is the difference between “as” and “is” operators in C#?
By Vivek Kumar in C# on Feb 08 2016
  • Jignesh Kumar
    Aug, 2018 26

    As operator and is operator both are used for typecasting check. As operator is safe way of doing type cast because it will return null in case it fails to type cast. Is also does the same thing but it will throw exception in case it fails to type cast.

    • 1
  • Vivek Kumar
    Feb, 2016 8

    “as” operator is used for casting object to type or class.“is” operator is used for checking the object with type and this will return a Boolean value.

    • 1

Most Popular Job Functions