Challenge 2: Calling a Method Directly on an int Literal — Possible Solution ==================================================================== Program.cs: Console.WriteLine(42.ToString()); // This compiles and runs without error in C# because int is not a // separate, non-object primitive category the way it is in Java -- // int is literally a built-in alias for System.Int32, a real struct. // A struct is a genuine type in the .NET type system with its own // methods, so calling ToString() directly on 42 is calling a real // method on a real (if lightweight) struct instance, no different in // principle from calling a method on any other object. // // In Java (java1-2), int is NOT an object at all -- it belongs to a // completely separate, non-object category of primitive types. // Attempting `42.toString()` directly on a raw int literal would not // compile in Java; the int would first need to be autoboxed into an // Integer (its wrapper class) before any method could be called on // it -- e.g. Integer.valueOf(42).toString(), or relying on // autoboxing to do that conversion implicitly in a context that // requires an object. Output: 42 WHY THIS WORKS AS AN ANSWER ------------------------------ This demonstrates the chapter's own "built-in types are just structs" reveal directly, and the explanation correctly identifies WHY this differs from Java: C#'s int is a genuine struct/object, while Java's int is a wholly separate, non-object primitive category requiring boxing before any method call is possible.