logo Practice-It logo

ParameterMysteryInt

Author: Kimberly Todd

What output is produced by the following program?

public class ParameterMysteryInt {
    public static void main(String[] args) {
        int a = 4;
        int b = 7;
        int c = -2;
        mystery(a, b, c);
        mystery(c, 3, a);
        mystery(a + b, b + c, c + a);
    }
    
    public static void mystery(int c, int a, int b) {
        System.out.println(b + " + " + c + " = " + a);
    }
}

Write the output of each call as it would appear on the console. (Do not put quotes around your answers.)

mystery(a, b, c);
mystery(c, 3, a);
mystery(a + b, b + c, c + a);

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.