What are the three types of loops?
For
While
Do-while
In object oriented programming, what is a class?
A category/ blueprint for creating objects
int[] grades = {42, 75, 84, 92, 77};
What is the value at grades[1] ?
75
What keyword is used in inheritance?
extends
What is a logical error?
When the output of the code doesn't match what the programmer expects
What are the three parts of a for loop?
for(??? ; ??? ; ???)
Starting point, end condition and increment.
In object oriented programming, what is an object?
A specific instance of a class
Declare an array of doubles called measures with 5 rows and 4 columns.
double[] measures = new double[5][4];
What keyword is used for the instance variables of a parent class?
protected
What is the name of the import we need when formatting currency?
NumberFormat
What type of loop do you use when you know how many times you would like to iterate?
For loop
What do we call a behavior that can be performed on an object?
A method
boolean[][] answers = new boolean[10][2];
What is the index of the element in the last row and last column of the answers array?
answers[9][1]
What is another word for a "child" class?
A subclass
What are the three legal characters you can start a variable with?
letter
$ (dollar sign)
_ (underscore)
How many iterations?
7
When you declare an instance variable as private, ____ has access to the variable.
Only the class itself
A two dimensional array can have rows of different lengths?
True
Which of the following will be inherited by a subclass?
public instance variables
protected instance variables
private instance variables
public instance variables
protected instance variables
What is the purpose of selection sort?
Selection sort puts the elements of an array in order from least to greatest.
Predict the output
1 2 3 4
What type of variable belongs to the entire class and not each object?
A static variable
int[] num = {4, 5, 8, 2, 7};
What would this method call return?
indexOf(num, 1);
-1
The word _____ is used when calling the constructor of the parent class.
super
Put the following Strings in lexicographic order:
Banana
apple
123orange
banana
APPle
Apple
orange
123orange
APPle
Apple
Banana
apple
banana
orange