Question: What will the following program print when run? Select the one correct answer. (a) 0 (b) 1 (c) 2 (d) 3 public class ParameterPass {
What will the following program print when run?
![public class ParameterPass { public static void main(String[] args) { int i](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/8/7/7/61065bce2aa038fc1706877609733.jpg)
Select the one correct answer.
(a) 0
(b) 1
(c) 2
(d) 3
public class ParameterPass { public static void main(String[] args) { int i = 0; addTwo (i++); System.out.println(i); } } static void addTwo (int i) { 1 += 2; }
Step by Step Solution
3.44 Rating (154 Votes )
There are 3 Steps involved in it
b Evaluation of the actual parameter i yields 0 and increments i to 1 in ... View full answer
Get step-by-step solutions from verified subject matter experts
