valueOf()

Concatenation – Conversion

We know earlier, the + operator is implicitly overloaded in Java – works for addition and concatenation. For concatenation, String class includes concat() method. That is, strings can be concatenated both with + operator an concat() method. Following program illustrates.

String s4 = s1+s2+s3; String s5 = s1.concat(s2); String…