Discussion: Java convert an Int to a String
In the previous quiz, Online Java Quiz, we tested our experience gained from the course.
3 messages from 3 displayed.
//= Settings::TRACKING_CODE_B ?> //= Settings::TRACKING_CODE ?>
In the previous quiz, Online Java Quiz, we tested our experience gained from the course.
The third method forces the compiler to convert n
to string.
Concatenating (adding strings together by using the + operator) even an empty
string in this case with anything else will always result in a string. So the
number has to be converted to make the resulting string. Anyway, this is a weird
method to do such thing and can be misunderstood, use the 2 above.
Hello,
Thanks for sharing this information.
Java Course
in Pune.
3 messages from 3 displayed.