Question: What will be the result of compiling and running the following program? Select the one correct answer. (a) 13 (b) 14 (c) 20 (d) 21
What will be the result of compiling and running the following program?
![public class EvaluationOrder { public static void main(String [] args) { int[]](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/3/7/90265bdce2e0355c1706937898754.jpg)
Select the one correct answer.
(a) 13
(b) 14
(c) 20
(d) 21
(e) 24
public class EvaluationOrder { public static void main(String [] args) { int[] array = {4, 8, 16 }; int i = 1; array[++i] = -1; System.out.println (array [0] + array[1] + array[2]); } }
Step by Step Solution
3.44 Rating (154 Votes )
There are 3 Steps involved in it
a First the expression i is evaluated resulting in the value 2 Now the variable i also has t... View full answer
Get step-by-step solutions from verified subject matter experts
