I don't even think that code will compile.
It compiles and runs properly.
My guess is doing value+"" is someone's way of forcing value to be a string instead of an integer. What you can do is
No it is not. If you are using + operator you need not to convert the non string value to string. The "" in OP's code has no significance.
Ok.
is same as
This is legal in Java. '+' operator can work between String and String,Integer,character,double,float.
'+' operator does convert the non string value into its corresponding string representation.
As far as OP's code is concerned i think OP want single string to store all the values with a new line character which is generated within that loop.
Regards
Dheeraj Joshi