Formatting a string array in java
Use a loop:
for (String s : array) {
System.out.print(String.format("%s ", s));
}
System.out.println();
you can use
System.out.format("%s". Arrays.toString(your_array));
Java 8:
String formatted = Stream.of(arrayOfStrings)
.collect(Collectors.joining(",","[","]"));
String formatted = Stream.of(arrayOfSomethingElse)
.map(Object::toString)
.collect(Collectors.joining(",","[","]"));