Strings and ints, implicit and explicit
问题 Had a coworker ask me this, and in my brain befuddled state I didn't have an answer: Why is it that you can do: string ham = "ham " + 4; But not: string ham = 4; If there's an implicit cast/operation for string conversion when you are concatenating , why not the same when assigning it as a string? (Without doing some operator overloading, of course) 回答1: When concatenating the compiler turns the statement "ham" + 4 into a call to String.Concat , which takes two object parameters, so the value