Toggle Navigation
Games
Blog
Class PIN
Join for Free
Sign in
Toggle Navigation
Games
PIN
Join for Free
Blog
Pricing
Contact us
Help center
Sign in
Study
Arrays in Java
0
%
0
0
0
Back
Restart
What is the term that refers to a collection of related elements used to store the same type of data called?
Array
Oops!
Okay!
What is the correct statement that gives the length of the array data?
data.length
Oops!
Okay!
What is the correct way to create an array called nums with the following three numbers? 12 8 15
int[ ] nums = {12, 8, 15};
Oops!
Okay!
What value is stored in each of the 5 elements in the following array?
0
Oops!
Okay!
What is the correct way to declare and initialize an integer array called numbers with 10 elements?
int [ ] numbers = new int[10];
Oops!
Okay!
What value is stored at index 1 in this array?
Dennis
Oops!
Okay!
What does the following code segment print out?
4
Oops!
Okay!
True of False: An array has a fixed length.
True
Oops!
Okay!
Given the following declaration, what are the legal index values for the array ar?
0, 1, 2, 3
Oops!
Okay!
Each element in a String array is automatically initialized to ___________.
null
Oops!
Okay!
Index values of an array range from ___________ to ___________.
0 to length – 1
Oops!
Okay!
What does the following code segment print out?
2
Oops!
Okay!
What is the correct way to create an array of 12 strings called months?
String[ ] months = new String[12];
Oops!
Okay!
True or False: An array can be used to store different types of data; such as: doubles and integers together.
False
Oops!
Okay!
How would you access the fourth element in array nums?
nums[3]
Oops!
Okay!
What does the following code segment print out?
6
Oops!
Okay!
Your experience on this site will be improved by allowing cookies.
Allow cookies