Category A
Category B
Category C
Category D
Category E
100

Java syntax requires most statements to end with this symbol

What is a semicolon? (;)

100

What does the method list.size() return for an ArrayList? 

What is the number of elements in the ArrayList?

100

What method would you use to add an element to an ArrayList?

What is add()?

100

This keyword is used to define a method that cannot be accessed outside of its class in Java

What is 'private'?

100

What logical operator is used to test if two conditions are both true in Java?

What is && (AND)?

200

What is the purpose of a constructor in a Java class?

What is to initialize objects of that class?

200

If you use the == comparison operator on two objects,what is being compared?

What are the locations in memory of the two objects?

200

This notation is used to check if two values are NOT equal

What is != ?

200

A process in which the evaluation of a logical expression exits when the result is clear, even before the complete evaluation of the expression

What is short-circuited evaluation?

200

What is the index of the last element in an array of size n?

What is n-1?

300

In the following code snippet, what will the getName() method return?

What is the name of the student passed to the constructor?

300

What keyword is used to make sure a method in a superclass CANNOT be overridden in a subclass?

What is 'final'?

300

How do you declare an ArrayList of Strings in Java?

What is ArrayList<String> list = new ArrayList<>();?

300

The keyword used to call the superclass constructor from a subclass

What is super()?

300

The range used to generate a number with Math.random() in Java

What is '[0,1)'?

(0 inclusive, 1 exclusive)

0 <= num < 1

400

What is the purpose of the 'this' keyword in a constructor?

What is to refer to the current object's instance variable (i.e., differentiating instance variables from parameters)?

400

This sorting algorithm is most efficient on a nearly sorted array.

What is insertion sort?

400

How can you retrieve only the third character of a string called myString? (assume myString is at least four characters long)

What is myString.substring(2, 3);

400

This sorting algorithm finds the smallest element in an unsorted array and places it at the beginning of the array in each iteration.

What is selection sort?

400

A set of logical laws used to demonstrate the equivalence of two Boolean expressions

What are 'De Morgan's Laws'?

500

How do you declare a two-dimensional array of integers with 3 rows and 4 columns in Java?

What is int[][] arr = new int[3][4];?

500

How can you retrieve only the third character of a string called myString? (assume myString is at least four characters long)

What is myString.substring(2, 3);

500

Write a recursive method to compute the factorial of a number n (i.e., n! = n * (n-1) * ... * 1).


500

How would you write a condition to check if a variable x is greater than 5 and less than 10 in a single statement?

What is 'if (x > 5 && x < 10)'?

500

This is an object-oriented programming concept where the instance variables of a class are hidden from other classes and can be accessed only through the methods of the class

What is 'Encapsulation'?

M
e
n
u