Question: CPS 1231 Chapter 6-lab 4 Fall 2017 Below is a program which passes a parameter value to a method, changePrimitive. Before running the program, predict
CPS 1231 Chapter 6-lab 4 Fall 2017 Below is a program which passes a parameter value to a method, changePrimitive. Before running the program, predict what it will print. Run the program. Answer the questions in the body of the class. Explain the results. public class ParameterTester //Before running this program, predict what will print public static void changePrimitive (int fi) 1-999 //Note that the value of fl is changed in the method System.out.printin("f1 =+11); public static void main (String [) args) int a1 =111; //Q1. what prints after the statement below runs? System.out.printin("before calling changePrimitive al-+a1) changePrimitive(a1); //Q2. What prints after the statement below runs? System.out.printin("after calling changePrimitive al"4al); //Q3. why did the value of al not change
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
