You are viewing a single comment's thread. Return to all comments →
We know that "" is of type String. It is known as the empty string. It is a String with no characters in it. The + operator, when used on the right side of a String, simply connects stuff to the right of the original String. If what it's connecting is not yet a String, it automatically converts it into one, which is what we want for this exercise.
"" + "Hello" + "there."
becomes the String "Hello there." and
"" + n
becomes the String n, where n was automatically converted into a String for us.
Thank you very much
3rd one was simple and smart.