Prim
& Objs 1
Boolean, If, Loops
Classes and Arrays
ArrayList and 2D Arrays
AP Question and Recursion
100

The three Primitive data types we use in AP CS A.

What are int, double, and boolean?

100

They mean logical AND and OR

What are && and || ?

100

It is the part of a class between the instance variables and the methods.

What is a constructor?

100

add()

How do you add an element to an ArrayList?

100

These are the 2 things you must have in a Recursive algorithm

Base Case and a Recursive call to the same method.

200

It adds with numbers, but concatenates with Strings.

What is the + symbol?

200

You use it to compare Objects, like Strings, to each other.

What is .equals()?

200

Instance Variables, Constructors, Methods

What are the 3 basic parts of a Class?

200

Row then Column

2D arrays are in what sort dimensional order?

200

Consider the following code segment.

String str1 = "LMNOP"; 

String str2 = str1.substring(3); 

str2 += str1.substring(2, 3);

What is the value of str2 after executing this code segment?

OPN

300

min, max, sqrt, abs, rand, and others.

What are some of the Math methods?

300

It is the first line of a method, with the method name and list of parameters. But, not the return type.

What is the method signature?

300

This is if you try to access an Array element that doesn't exist.

What is an out of bounds error?

300

arr[0] would be the first one

How would you get the first Row of a 2D array?

300

Consider the following code segment.

int x = ((int) (Math.random() * 10)) + 5; 

int y = ((int) (Math.random() * 5)) + 10; 

System.out.println(x + y);

What is the max and min values that could be printed?

What is 15 and 28?

400

When we give a variable a name and type. (And set aside memory to store the variable value).

What is Declare or Declaration?

400

It is how you "carry" a NOT (!) through a compound Boolean expression   !( A && B) = !A || !B

What is DeMorgan's Law?

400

You use this if you don't want to make an actual Object, but want to be able to run Methods from a Class.

What is static?

400

Linear Search

What is when you start at one end of an array (or arraylist) and check each element in turn.

400

What is 15 times?

500

It gives us part of a String.

What is .substring()?

500

They are the Object versions of primitives.

What are Integer and Double?

500

It is when you make the variables or fields Private, but the methods Public

What is Encapsulation?

500

Binary Search

With an ordered (sorted) array, you can pick the center and halve, making a search faster.

500

What is the result of mystery(1234)

What is 43211234?

M
e
n
u