Intermediate C#
Q46 / 100

What is pattern matching in C#?

Correct! Well done.

Incorrect.

The correct answer is B) A language feature for testing expressions against patterns (type, constant, property) in switch and if statements

B

Correct Answer

A language feature for testing expressions against patterns (type, constant, property) in switch and if statements

Explanation

if (obj is int n) { } or switch(shape) { case Circle c when c.Radius > 5: } are patterns. C# 8-12 continuously expanded pattern types.

Progress
46/100