logo CodeStepByStep logo

printMaxMin

Language/Type: Java basics mystery println variables

The following code generates four lines of output. What are they?

int max;
int min = 10;
max = 17 - 4 / 10;
max = max + 6;
min = max - min;
System.out.println(max * 2);
System.out.println(max + min);
System.out.println(max);
System.out.println(min);
line 1
line 2
line 3
line 4

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.