We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Java Int to String
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.
becomes the String "Hello there." and
becomes the String n, where n was automatically converted into a String for us.
HackerRank solutions.