Arrays part one
Arrays part two
ArrayLists
Loops
Strings
100

A/an ______ holds a fixed number of values of one data type.

Array

100

True or False

You must include the data type when creating an Array?

True

100

A Class in Java which extends AbstractList and implements the List interface and provides us with dynamic arrays.

ArrayList

100

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

100

This class is part of the java.lang package and represents a sequence of characters.

String

200

This first element of an Array will be at index ____

0

200

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

200

True or False

An ArrayList can hold either primitive data types or Objects.

ArrayList<Obj> myObj = new ArrayList<>();

ArrayList<int> myInt = new ArrayList<>();

False

200

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

200

This method will return the length of a String.

length()

300

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"};


300

What is the length of the following Array: 

int[ ] myArr = {0, 1, 2, 3, 4, 5};

6

300

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

300

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

300

This method can be used to join two strings together.

concat()

400

To use the toString() method, you must import which package?

java.util.Arrays

400

If we create an empty array of size 5 and of type 

int[ ], what will be the initialized value of each element?

0

400

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

400

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

400

What will the following code output?

String one = new String("Hello");
String two = new String("Hello");
System.out.println(one == two);

false

500

What will be the output of the following code?

int[ ] myNum = {1, 2, 3, 4, 5}

System.out.println(myNum[5]);

ArrayIndexOutOfBoundsException

500

What are the two components of an Array declaration?

1. The array's type

2. The array's name

500

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

500

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

500

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

M
e
n
u