class Main {
public static void main(String[] args) {
String text = """
first
second
third""";
// lines() returns a Stream<String>, one per line
text.lines().forEach(System.out::println);
}
}text block plus lines()