← all problems

Print two lines with one statement 🌶️

Write code in the box that prints these two lines, using a single System.out.println statement: Roses are red on the first line and Violets are blue on the second line. Java has an escape sequence that means "start a new line," a backslash followed by a letter, written inside the quotes of the String. This makes Java put the same "newline" character that your keyboard's enter/return key produces into the String.

Main.java — the program frame below is already written; you're only completing the code in the editable box.

public class Main {
    public static void main(String[] args) {
        // ---- write your code below ----
    }
}