Mixed 1
Mixed 2
Arrays
ArrayLists
2D Arrays
100

This keyword denotes that the value of a variable cannot be updated, for example when using a constant, like the speed of light.

What is final?

100

If a recursive method doesn't have a condition to stop the recursions, we get a run-time error called...

What is an infinite loop?

100

In a method to find the maximum value in an array called "incomes", we initialize the variable holding the maximum to this value...

What is prices[0]?

(or the first element in prices)

100

What data type do ArrayLists require?  

(Which is a reason why wrapper classes and autoboxing are needed)

What are objects of a class?


100

What is the index of the bottom right element in a 4 x 8 array?

What is [3][7]?

(coordinates ok)

200

This term refers to writing more than one version of a method using the same name, but different parameters.

What is overloading?

200

The condition that stops recursive calls.

What is the base case?

200

Write a "for i" loop condition to traverse the elements in an array of Strings called nbaTeams.

You must be completely accurate

for (int i = 0; i<nbaTeams.length; i++)

200

Write a "for i" loop condition to traverse the elements in an ArrayList of Strings called nbaTeams, in REVERSE.

You must be completely accurate.

for (int i = nbaTeams.size() - 1; i >=0; i-- )

Write a "for i" loop condition to traverse the elements in an array of Strings called nbaTeams.

You must be completely accurate


200

Declare and initialize an array called "letters" with these values:

a  b  c

d  e  f

What is String letters = {{a,b,c}, {d,e,f}};

300

The automatic conversion the Java compiler makes between primitive types and their wrapper classes. For example, converting an int to an Integer, or a double to a Double

What is autoboxing?

300

When tracing recursive methods, first you build the _______and then execute it in _________

What is....stack, reverse

300

Write an enhanced for loop condition to traverse an array of Animal objects called zoo.  (zoo is the array name)

for (Animal beast: zoo)

(local variable name "beast" can vary

300

While traversing an Arraylist using the condition for (Student warrior : roster), write a condition to check if the current element has the name "Jair"

What is... if (warrior.getName().equals("Jair"))?

300

Declare a 10 x 5 array of doubles called "prices"

What is double[][] prices = new double[10][5];

400

This phrase describes the fact that if the first part of an AND conditional is false, the second part is not checked.

What is short circuit evaluation?

400

Here is an example of this technique, in this case used to override integer division:

(double)10/3

What is typecasting?

400

An enhanced for loop can traverse an array from beginning to end and access its elements.  Name two things it cannot do.

What is modify the array and do anything but go from beginning to end? (answers may vary)

400

Write a single command that would declare and initialize an ArrayList of Integers called "ages"  (you don't need to populate it).

What is ArrayList<Integer> ages = new ArrayList<Integer>();

400

Write the conditions for a nested enhanced for loop to traverse a 2D array of integers called stuff.  You can leave out curly brackets.

for (int[] row: stuff )  

    for(int column : row)

(local variable names may vary)

500

This keyword indicates that a private variable value is shared by ALL objects of a class, for example "totalStudents".

What is a static?

500

This type of method allows us to print an objects information using the command System.out.print().

What is toString()?

500

Write a command to access the name of a Student object at index i, in an array called roster.

(Assume conventional getter names.)

What is roster[i].getName() ?

500

Write a command that would set the name of an Animal at index 5 in an arrayList called pets to "Captain".

What is roster.get(5).setName("Captain");

500

Write the conditions for a nested "for i" loop to traverse a 2D array called stuff.  You can leave out curly brackets.

for(int r = 0; r < stuff.length; r++)

    for(int c = 0; c < stuff[0].length; c++)