17+ practice questions focused on Arrays and Methods — one of the most tested topics on the Oracle Java Foundations 1Z0-811 exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start Arrays and Methods PracticeA developer writes a method that takes an int array and returns the sum of its elements. The method signature is: 'public static int sumArray(int[] arr)'. Which statement correctly calls this method?
Explanation: Option A is correct because it uses the correct syntax for creating and passing an anonymous int array to the sumArray method. The expression `new int[]{1,2,3}` creates an int array object with the specified elements, which matches the method's parameter type `int[]`. The method then returns the sum, which is assigned to the int variable `result`.
Given the code snippet: 'int[] nums = {10, 20, 30, 40}; int sum = 0; for (int i = 0; i < nums.length; i++) { sum += nums[i]; }'. What is the value of sum after execution?
Explanation: The correct answer is A (100) because the for loop iterates over each element of the array {10, 20, 30, 40} and adds it to the sum variable. The sum starts at 0, and after adding 10, 20, 30, and 40, the total becomes 100.
A method 'public static void modifyArray(int[] arr) { arr[0] = 99; }' is called with 'int[] myArray = {1,2,3}; modifyArray(myArray); System.out.println(myArray[0]);'. What is the output?
Explanation: In Java, when an array is passed to a method, the reference to the array is passed by value. This means the method receives a copy of the reference, but both the original and the copy point to the same array object in heap memory. Therefore, modifying an element of the array inside the method (arr[0] = 99) directly changes the original array's content. When myArray[0] is printed after the call, it outputs 99.
Which of the following correctly declares and initializes an array of strings with the elements "A", "B", and "C"?
Explanation: Option D is correct because in Java, an array can be declared and initialized using the array initializer syntax with curly braces `{}` directly after the declaration, as in `String[] arr = {"A", "B", "C"};`. This is a shorthand that implicitly creates a new array object with the specified elements, and it is only valid in a declaration statement (not in an assignment to an already-declared variable).
A method 'public static int findMax(int[] numbers)' returns the maximum value in the array. Which implementation correctly handles an empty array by returning 0?
Explanation: Option D correctly handles an empty array by checking `numbers.length == 0` and returning 0 before attempting to access `numbers[0]`, which would throw an `ArrayIndexOutOfBoundsException` on an empty array. It then initializes `max` to the first element and iterates from index 1, ensuring all elements are compared correctly even if all numbers are negative.
+12 more Arrays and Methods questions available
Practice all Arrays and Methods questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Arrays and Methods. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
Arrays and Methods questions on the 1Z0-811 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. Arrays and Methods is tested as part of the Oracle Java Foundations 1Z0-811 blueprint. Practicing with targeted Arrays and Methods questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free 1Z0-811 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but Arrays and Methods is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full Arrays and Methods practice session with instant scoring and detailed explanations.
Start Arrays and Methods Practice →