11. How do you find the number of rows in a two-dimensional array named matrix in Java? A. matrix.rows() B. matrix.size() C. matrix.length D. matrix.length() Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
12. What is the default initial value of elements in an array of type boolean in Java? A. TRUE B. FALSE C. 1 D. 0 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
13. Which of the following statements is true about arrays in Java? A. Arrays can change in size after initialization. B. Arrays can store elements of different types. C. Arrays can have a negative length. D. Arrays are objects of type Array. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
14. What is the correct way to copy the elements of one array to another in Java? A. Use a for loop to iterate through the elements and copy them one by one. B. Use the clone() method of arrays. C. Use the copy() method of arrays. D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
15. How do you declare and initialize an array of integers with 5 elements in Java? A. int[] numbers = new int[5]; B. int[5] numbers; numbers = {1, 2, 3, 4, 5}; C. int numbers[5] = {1, 2, 3, 4, 5}; D. All of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
16. How do you declare a dynamic array (ArrayList) of integers in Java? A. ArrayList numbers = new ArrayList(); B. ArrayList numbers = new ArrayList(); C. ArrayList numbers[] = new ArrayList[5]; D. int[] numbers = new int[5]; Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
17. What is the purpose of the System.arraycopy() method in Java? A. To copy elements from one array to another. B. To compare two arrays. C. To reverse the elements of an array. D. To find the length of an array. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
18. Which of the following is true about the size of an ArrayList in Java? A. The size is fixed and cannot change. B. The size can only increase but not decrease. C. The size can change dynamically. D. The size is determined by the length of the elements. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
19. In Java, how do you remove an element at a specific index from an ArrayList named list? A. list.remove(index); B. list.delete(index); C. list.pop(index); D. list.splice(index); Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
20. How do you check if an element exists in an array or ArrayList in Java? A. Use the find() method. B. Use the search() method. C. Use the contains() method. D. Use the exists() method. Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board