how to print each element of an arraylist on a new line in java

Java
list.forEach(t -> System.out.println(t));for (String element : list) {
    System.out.println(element);
}list.forEach(System.out::println);
Source

Also in Java: