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[] num = {4, 5, 8, 2, 7};
What is the value at num[1] ?
5
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 is it called when you put one loop inside of another?
Nested loops
In object oriented programming, what is an object?
A specific entity or example of a class
Declare an array of doubles called grades with 5 rows and 4 columns.
double[] grades = new double[5][4];
What is another word for a "child" class?
What are the three legal characters you can start a variable with?
letter
$ (dollar sign)
_ (underscore)
What type of loop do you use when you know how many times you would like to iterate?
For loop
True or False
A class can have only one constructor
False
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 keyword is used in inheritance?
Extends
What is the purpose of selection sort?
Selection sort puts the elements of an array in order from least to greatest.
How many iterations will occur?
7
What is another name for getters and setters?
Accessors and mutators
What type of loop is used to fill a two dimensional array?
Nested for loops
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 relationship between the length and index of an array?
Length starts at 1, index starts at 0
How many iterations will occur?
012i
012i
012i
When you declare an instance variable as private, ____ has access to the variable.
Only the class itself
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
What are the three parts of a for loop?
for(??? ; ??? ; ???)
Starting point, end condition and increment.
What type of variable belongs to the entire class and not each object?
A static variable
True or False
A two dimensional array can have rows of different lengths?
What does it mean when a class is abstract?
You can't instantiate objects from an abstract class
What is as logical error?
When the output of the code doesn't match what the programmer expects