I've searched hours for this kind of problem, but I've got no luck.
In Java, I'm try to get this kind of output:
1, 2, 3
(without the use of StringBuilder)
The result I am getting is:
1, 2, 3,
with the code:
for(int i=1; i <= 3; i++){
String output = "";
output += i + ", ";
System.out.print(output);
}
p.s I am not using any arrays for my code.