Challenge 2: Type Patterns Over an object — Possible Solution ==================================================================== Program.cs: static string Describe(object obj) => obj switch { int n => $"an int with value {n}", string s => $"a string of length {s.Length}", null => "a null reference", _ => "something else entirely" }; Console.WriteLine(Describe(42)); Console.WriteLine(Describe("hello")); Console.WriteLine(Describe(null)); Console.WriteLine(Describe(3.14)); Output: an int with value 42 a string of length 5 a null reference something else entirely Explanation: Each case is a type pattern -- `int n` matches only if obj is genuinely an int, binding it directly to n with no separate cast, the same style java1-3's own instanceof pattern matching introduced but built directly into switch here. The dedicated `null` pattern matches specifically when obj is null, distinct from any type pattern. The discard `_` catches every value none of the earlier patterns matched -- here, a double. WHY THIS WORKS AS AN ANSWER ------------------------------ This uses the chapter's own type-pattern, null-pattern, and discard- pattern syntax together in one switch expression, covering four distinct cases (int, string, null, and an unmatched type) to demonstrate each pattern kind actually firing correctly.