logo CodeStepByStep logo

ParameterMystery1

Language/Type: Java parameters

The following console program uses parameters and produces two lines of output. What are they?

public class ParameterMystery1 {
    public static void main(String[] args) {
        int x = 9;
        int y = 2;
        int z = 5;

        mystery(z, y, x);
        mystery(y, x, z);
    }

    public static void mystery(int x, int z, int y) {
        System.out.println(z + ", " + (y - x));
    }
}
line 1
line 2

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.