1. A message dialog displaying Oranges will appear
2. The message dialog displays the original value of a, which is 3. The a that is set to 0 inside the method is a local variable.
3. Here are the stages in replacing a call by its result. For:
n = areaRectangle(10, 20);
we have:
n = 200;
For the line:
JOptionPane.ShowMessageDialog(null, "area is " +
areaRectangle(3, 4));
we have the stages:
JOptionPane.ShowMessageDialog(null, "area is " + 12);
JOptionPane.ShowMessageDialog(null, "area is 12");
n = areaRectangle(10, 20) * areaRectangle(7, 8);
n = 200 * 56;
n = 11200;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here