Java Tutorial #7 Quiz

Q1: Arrays are used to associate multiple values to a single variable.

Q2: Which of the following is a proper array declaration?

Q3: Given the following array of numbers choose the value at index 2.
int[] myArray = {3,0,5,9};

Q4: If an array has 7 items what would the index of the last value be?

Q5: Choose the correct output statement to print out 9 from the array below.
int[] myArray = {3,0,5,9};

Q6: Choose the statement that replaces the word "great" with the word "awesome" in the array below.
String myArray = {"Freetechtorials", "is", "great"};

Did you find our site helpful? Consider donating to help us provide more quality content.