1Z0-811 • Practice Test 34
Free 1Z0-811 practice test — 15 questions with explanations. Set 34. No signup required.
A payroll system stores weekly hours in an int array. A developer writes a method that should double every element in the array and return the sum of the modified values. The method signature is public static int process(int[] hours). Inside the method, the developer uses a for-each loop: for (int h : hours) { h = h * 2; } and then sums the elements. What is the result when the method is called with an array containing {1, 2, 3}?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.