 Arrays
2 years ago
wespetal
Save
Edit
Host a game
Live GameLive
Homework
Solo Practice
Practice 10 QuestionsShow answers
• Question 1
120 seconds
Report an issue
Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
System.out.println("Number: " + numArray);
Number: 2
Number: 7
Number: 4
Number: 12
• Question 2
120 seconds
Report an issue
Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
System.out.println("Number: " + numArray);
Number: 2
Number: 7
Number: 4
Number: 12
• Question 3
120 seconds
Report an issue
Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
System.out.println("Number: " + numArray[numArray.length - 1]);
Number: 2
Number: 0
Number: 12
Number: 6
• Question 4
120 seconds
Report an issue
Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
System.out.println(numArray.length);
4
5
6
7
• Question 5
120 seconds
Report an issue
Q. What is the correct way to initialize an array with 10 positions?
int numbers = new int;
int[] numbers = new int[];
int numbers = new int;
int[] numbers = new int;
• Question 6
120 seconds
Report an issue
Q. What value is stored in each of the 5 positions in this array? (What is the default value provided by Java).
int[] numbers = new int;
null
1
0
nothing
• Question 7
120 seconds
Report an issue
Q. What value is at index 1 in this array?  String[] names = {"Mack", "Dennis", "Dee", "Charlie"};
Mack
Dennis
Dee
Charlie
• Question 8
120 seconds
Report an issue
Q. What value is at index 3 in this array?  String[] names = {"Mack", "Dennis", "Dee", "Charlie"};
Mack
Dennis
Dee
Charlie
• Question 9
120 seconds
Report an issue
Q. What is the correct way to create an array with these three numbers: 12  8  15
int[] = {12, 8, 15};
int[] nums = {12  8  15};
int[] nums = {12, 8, 15}
int[] nums = {12, 8, 15};
• Question 10
120 seconds
Report an issue
Q. True or False:  An array can be store different types of data (like store both doubles and ints).