WHAT IS DIFFERENCE BETWEEN IS AND AS OPERATORS IN C#?

Anchal Kesharwani

Total Post:15

Points:75
Posted by  Anchal Kesharwani
.NET  C# 
C#
 1174  View(s)
Ratings:
Rate this:
  1. Anchal Kesharwani

    Post:15

    Points:75
    What is difference between is and as operators in c#?

    “is” operator is used to check the compatibility of an object with a given type and it returns the result as Boolean.

    “as” operator is used for casting of object to a type or a class.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!