MCQ Quiz with Score

Multiple Choice Quiz

1:What is an array in Java?




2: How is the length of an array determined in Java?




3:Which of the following statements initializes an array of integers with a size of 5?




4:How do you access the element at index 2 of an array named arr?




5: What will be the output of the following code snippet? int[] values = {3, 7, 2, 8}; System.out.println(values[1]);




6: Which loop is commonly used to iterate through elements of an array in Java?




7: What is the index of the last element in an array with a length of 10?




8: Which method is used to sort an array in ascending order in Java?




9: In Java, can the size of an array be changed once it's created?




10: What happens if you try to access an index that is out of bounds in an array?z