A/an ______ holds a fixed number of values of one data type.
Array
True or False
You must include the data type when creating an Array?
True
A Class in Java which extends AbstractList and implements the List interface and provides us with dynamic arrays.
ArrayList
A programming tool that allows developers to repeat the same block of code until some condition is met. while, for, and for-each are some examples.
A loop
This class is part of the java.lang package and represents a sequence of characters.
String
This first element of an Array will be at index ____
0
How would we access the value "15" from the following Array?
int [ ] numArr = {10, 11, 12, 13, 14, 15, 16}
numArr[5]; or index 5
True or False
An ArrayList can hold either primitive data types or Objects.
ArrayList<Obj> myObj = new ArrayList<>();
ArrayList<int> myInt = new ArrayList<>();
False
This type of loop is similar to an if statement and will only run if the condition is true. It is common to use a counter or iterator variable within the body of this loop.
while loop
This method will return the length of a String.
length()
What is the correct syntax to create an Array?
A) String{ } myArray = {"Hello", "World"};
B) String{ } myArray[ ] = {"Hello", "World"};
C) String[ ] myArray = {"Hello", "World"};
D) String[ ] myArray = ["Hello", "World"];
C) String[ ] myArray = {"Hello", "World"};
What is the length of the following Array:
int[ ] myArr = {0, 1, 2, 3, 4, 5};
6
True or False
To access a value at a particular index in an ArrayList we use bracket notation
array[2]
False
You would use the get() method
This type of loop is made up of three parts, the initialization of the loop control variable, a boolean expression, and an increment or decrement statement.
for loop
This method can be used to join two strings together.
concat()
To use the toString() method, you must import which package?
java.util.Arrays
If we create an empty array of size 5 and of type
int[ ], what will be the initialized value of each element?
0
True or False
Consider the following ArrayList named pets ["Dog", "Cat", "Bird"]
To change "Cat" to "Mouse" we could do the following: pets[1] = "Mouse";
False
You would use the set() method
The ________ statement or keyword can be placed inside of a loop if we want to skip an iteration. If it is executed, the current loop iteration will immediately end and the next iteration will begin.
continue statement or continue keyword
What will the following code output?
String one = new String("Hello");
String two = new String("Hello");
System.out.println(one == two);
false
What will be the output of the following code?
int[ ] myNum = {1, 2, 3, 4, 5}
System.out.println(myNum[5]);
ArrayIndexOutOfBoundsException
What are the two components of an Array declaration?
1. The array's type
2. The array's name
When we create an ArrayList, if we do not specify the initial capacity of the ArrayList, it will be created containing an initial capacity of size ____.
10
Also referred to as enhanced loops, _______ loops allow us to directly loop through each item in an array and perform some action with each item.
for-each
What would be the output of the following code?
String myString =
"I love jeopardy because it is so much fun!!!";
System.out.println(myString.substring(16, 35));
because it is so mu