This term is used for inheritance from super class.
What is extends?
100
Given an array arr[] of ints {3, 5, 4, 7}, what value is in arr[2]?
What is 4?
100
This kind of string, immutable and defined in code, is delimited by double-quotes (e.g. "Hello")
What is a string literal?
100
When a method name has more than one body defined, differentiated by unique lists of parameters, they are called this.
What is overloaded method?
100
int x = 1;
while (x != 100)
x*=2;
System.out.println(x);
This is the the result of the executing the code above.
What is an infinite loop?
200
These comments define the expected state of an object after a method's execution.
What are postconditions?
200
Given an ArrayList named arr of ints {3, 5, 4, 7, 6, 9, 2}, this is the single method call that returns the value "7".
What is "arr.get(3);"?
200
"abcdefgh".substring(2, 4)
What is "cd"?
200
Similar to an abstract class, but with no implementations
What is an Interface?
200
The number of times the following nested loop structure will execute the inner most statement (x++)
for(int j = 0; j <= 100; j += 2)
for(int k = 100; k > 0; k--)
x++;
What is 5100?
300
When a program includes an OR statement and the first input is true, or when it includes an AND statement and the first input is false, this happens, preventing the second statement's evaluation.
What is short-circuiting?
300
To get the number of elements in an array, you use ____; to get the number of elements in an ArrayList you use ____. (Make sure to include parentheses where necessary)
What are "length" and "size()"?
300
"Hello".length() % 4 - 2*"Hello".indexOf("l")
What is -3?
300
To use an object, you must do these two things.
What are Declare and Instantiate?
300
if (num > 0)
if (num < 10)
System.out.println("AAA");
else
System.out.println("BBB");
This is printed after executing the code above if num = 20.
x = x + 3;
else
x = x + 2;
The value of x if initially x = 0; a = b = 5.
What is 5?
400
The binary number corresponding to 19 (decimal)
What is 10011?
400
When constructing an ArrayList, you cannot use this type of variable for the ArrayList's type.
What is a primitive variable?
400
The result of the line
System.out.print("ABC" + 2*5 - 2);
What is error?
400
A cat ____ an animal, A cat ____ a color
What are Is-a and Has-a?
400
Given the method, what is returned if we call it with x = 10.
public boolean mystery(int x){
if (x == 0) return true;
else if (x < 0) return false;
else return mystery(x - 2);
}
What is true?
500
This set of classes are thrown as error messages.
What are Exceptions?
500
This is the primary reason one would use an ArrayList over an Array.
What is dynamic resizing? (Or the ability to add elements/remove elements/change size/etc.)
This describes the concept of combining data and methods into one object, such that the data can only be accessed through the methods.
What is Encapsulation?
500
This is missing in the code so that it prints 0.2, 0.4, 0.6, 0.8
for ( int j = 2; j < 10; j+=2 )
System.out.print( __________ + ", " );
System.out.println( );