Question: JAVA question For the following code, remember to make a table to keep track of the various x y z values. public class Mystery6 {

JAVA question
For the following code, remember to make a table to keep track of
the various x y z values.
public class Mystery6 {
public static void main(String[] args) {
int x = 1;
int y = 2;
int z = 3;
z = mystery(y, x, y); // Statement 1
System.out.println(x + " " + y + " " + z); // Statement 2
x = mystery(z, y, x); // Statement 3
System.out.println(x + " " + y + " " + z); // Statement 4
y = mystery(z, y, y); // Statement 5
System.out.println(x + " " + y + " " + z); // Statement 6
}
public static int mystery(int z, int x, int y) {
z--;
x = 2 * y + z;
y = x - 1;
System.out.println(y + " " + z);
return x;
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!