Your first Java program

What appears in the console?

Examples

Worked example

Input
System.out.println(3 + 4);
Expected output
7

Hints and solution

Hint 1

Write down the starting state and walk through one example by hand.

Reveal worked answer

Java evaluates the addition and passes the resulting integer to println.

Back to the lesson