Skip to content
Sharp

Language Upgrades · interview question

In the context of pattern matching, what advantage does using 'var' provide?

Multiple choiceEasychapter-12-curatedpremiumlanguage-upgradespattern-matching
Choose one answer
Answer and explanation

Correct answer

D. It automatically infers the type.

Why

Using 'var' in pattern matching allows the type to be automatically inferred, reducing boilerplate code and improving readability.

Test yourself on Language Upgrades

A free test with instant, explained results. No account needed.

Start free test
All Language Upgrades questions →