0

When I use string.concat(something.toString()); it doesnt works but on the other hand if i do simple concatenation it works.

For example

Integer x = 5;
String y = "Number is : ";    
y.concat(x.toString());
System.out.println(y);

this output is >> Number is :

but if I do this >> y = y + x.toString(); the output is >> Number is : 5

usamagk
  • 9
  • 2

0 Answers0