how to print array without brackets and commas in java

www.l‮‬autturi.com
how to print array without brackets and commas in java
/**
 * @author lautturi.com
 * Java example:  how to print array without brackets and commas in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		int[] arr = { 1, 3, 5, 2, 4 };
		String str = Arrays.toString(arr).replace(",", "")
				.replace("[", "")
				.replace("]", "") 
				.trim();
		System.out.println(str);

	}
}

output:

1 3 5 2 4
Created Time:2017-09-12 22:42:10  Author:lautturi