Advanced
C#
Q92 / 100
What is the C# abstract record and how does it interact with pattern matching?
Correct! Well done.
Incorrect.
The correct answer is B) Abstract records provide a base for record hierarchies; switch expressions can use positional patterns on derived records for exhaustive case handling
B
Correct Answer
Abstract records provide a base for record hierarchies; switch expressions can use positional patterns on derived records for exhaustive case handling
Explanation
abstract record Shape; record Circle(double R) : Shape; switch(shape) { case Circle(var r): ... } uses positional deconstruction pattern matching on the record hierarchy.
Progress
92/100