Objects
What import do you have to use for Wrapper Classes?
None, they are by default in the Java Library, meaning they are used without any special imports.
What is another name for Attributes?
What is a sequential search?
An algorithm that searches array elements, one by one, until a target value is found.
What is a process for determining what methods a class or program should have?
Design Process
RegularPolygon rp = new RegularPolygon(3, 50, Color.BLUE);
rp.translate(100, 100);
what does this code do?
It creates a three sided polygon(triangle), with a radius of 50, and sets the color to blue. It also turns populates it at the point 100,100.
What arithmetic class from java.math would be used to make an arbitrarily large numbers?
A) LargeNumber
B) BigNumber
C )BigInteger
c) BigInteger
How many arguments should a constructor class take?
None. They initialize instance variables to 0.
What is the row-major order?
Storing data in a 2D array, first by rows and then by columns.
What does UML stand for?
Unified Modeling Language.
for (int a = 0; a<array.length; a++){
for (int b = 0; b<array[a].length; b++){
string += array[a][b];
}
System.out.println(string)
}
It is traversing through a 2D array and printing out the results of what it does.
What is it called when you have an array with no elements and a length of zero?
An Empty Array
What is the difference between a value constructor and a constructor?
A value constructor takes in arguments that are equal to the number of instances variables, while constructors have no arguments.
What is it called when you have more than one array together (array[a][b])?
A Multi-Dimensional Array.
What occurs when a local variable or parameter has the same name as an attribute?
Shadowing
What is returned?
int a = 3;
int b = 4;
int c = a * (a + b);
String alpha = "Same";
String bravo = "Sa" + "me";
if (c <= 40) {
if (alpha.equals(bravo)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
True
To generalize
What is a Client?
A class that uses objects defined in another class.
What is it called when you represent one set of values using another set of values by constructing a mapping between them.
Encoding.
What are you doing when you represent one set of values using another set of values by constructing a mapping between them?
Encode
Integer x = Integer.valueOf(123);
Integer y = Integer.valueOf(123);
if (x == y) {
return ___;
}
if (x.equals(y)){
return ___;
}
x == y - false
x.equals(y) - true
You can use the key word 'null' in any variable in the java library.
True
or
False
False. You can only use it in object variables(Strings and/or arrays).
What is it called when you create a new instance of a class in the computer's memory?
Nested for loops.
What is a computer graphic that may be moved or otherwise manipulated on the screen?
Sprite
Why is my code not running?
String alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int bravo = 1;
int charlie = 2;
string delta = "Hello World!";
System.out.printnl(alpha + bravo + charlie + delta);
'println' is miss spelled.
String delta needs to be capitalized.