print on separate lines java array code example
Example 1: how to print each element of an arraylist on a new line in java
list.forEach(t -> System.out.println(t));
Example 2: how to print each element of an arraylist on a new line in java
for (String element : list) {
System.out.println(element);
}