I have an output that comes out printing : 1 2 3 4 5  

I want the output to be : 1,2,3,4,5  

When I print my final array, It looks like : System.out.println(D);  

What should I add to it to suit my needs.  

All answers are welcome.