Question: Given the following Java program, public class PassPrimitiveByValue { public static void passMethod(int p) { p = 10; } public static void main(String[] args) {
Given the following Java program,
public class PassPrimitiveByValue { public static void passMethod(int p) { p = 10; } public static void main(String[] args) { int x = 3; passMethod(x); System.out.println("After invoking passMethod, x = " + x); } } What will be the output?
Select one:
a) After invoking passMethod, x = 3
b) After invoking passMethod, x = 13
c) After invoking passMethod, x = + 10
d) After invoking passMethod, x = + 3
e) After invoking passMethod, x = 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
