Statements run top to bottom, in the order written. Each println prints its own line, so N println statements make N lines.
println
System.out.println("one"); System.out.println("two"); System.out.println("three");
Three printlns, three lines, in code order: one, two, three.
▶ Try it: run this, then change something and run it again.
Which word is printed first?
System.out.println("one"); System.out.println("two");
How many lines does this print?
System.out.println("a"); System.out.println("b"); System.out.println("c");
Arrange the lines so the program prints red, then green, then blue.
red
green
blue
Which word is printed last?
System.out.println("red"); System.out.println("green"); System.out.println("blue");
Type exactly what this program prints.
public class Main { public static void main(String[] a){ System.out.println("red"); System.out.println("green"); }}