List of String
List<String> list = Arrays.asList("1", "2", "3"); System.out.println(String.join(", ", list));
Output:
1, 2, 3
List of Object
List<Object> list = Arrays.asList(new Object(), new Object(), new Object()); System.out.println(Arrays.toString(list.toArray()));
Output:
[java.lang.Object@1b6d3586, java.lang.Object@4554617c, java.lang.Object@74a14482]