Computer Science, asked by davidrosen1900, 9 months ago

What is the output of the following program?public class MysteryProgram { public static void main(String[] args) { int x = 3; doubleMe(x); System.out.println("x doubled is " + x); } public static void doubleMe(int x) { x = x * 2; } }

Answers

Answered by amruthamanisai587
3

Answer:

you will get the output as "x doubled is 3"

Explanation:

here in doubleMe() we are not returning any value and the scope of the operation x=x*2 will be in that function only so there will be no change in the value of x

Similar questions