What is the difference between is and as operators?

Junior C#

Answer

is: Checks whether an object is of a specific type.

as: Attempts conversion and returns null if conversion fails.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice