Skip to main content
🔮 Output PredictionC# C# / .NET Hard⚡+35 XP

Pattern Matching Switch

What does this print when shape is a Circle?

C# / .NET
string Describe(object shape) => shape switch {
  Circle c => $"Circle r={c.Radius}",
  Square s => $"Square side={s.Side}",
  _ => "Unknown"
};

🔮 What is the output?