Question: What is the main difference between the is and as operators?
- The is operator checks instance types, while the as operator checks the inherited type.
- The is operator checks primitive data types, while the as operator checks the object type.
- The as operator checks object type, while the is operator attempts to cast an object to a specific type.
- The is operator checks object type, while the as operator attempts to cast an object to a specific type.
Answer: The correct answer of the above question is Option D:The is operator checks object type, while the as operator attempts to cast an object to a specific type.