OOPs! I did it again!
A Loop in Time
Let's Get Arrays
It Runs in the Family
Code to the Future
200

This keyword refers to the current object in a class.

What is `this`?

200

This is the output of this loop:

for (int i = 1; i <= 3; i++)
     System.out.print(i);

What is 123?

200

This code creates an array of 10 doubles.

What is double[] arr = new double[10];?

200

This keyword is used when a class inherits from another.

What is extends?

200

This method returns true if the input integer is odd.

What is return n % 2 != 0;?

400

This principle is followed when instance variables are declared private.

What is encapsulation?

400

This type of loop is preferred when the number of iterations is not known in advance.

What is a while loop?

400

This method removes an element from an ArrayList by index.

What is .remove(index)?

400

This keyword allows a subclass constructor to call a parent constructor.

What is super()?

400

This is the result of
String s = "ab";
s += "cd";
System.out.print(s);

What is abcd?

600

This is the value of a static counter incremented in a constructor after 3 objects are created.

What is 3?

600

This type of loop never terminates because the condition always evaluates to true.

What is an infinite loop?

600

This loop structure is commonly used to traverse all elements in an array.

What is a for-each loop?

600

This type of method cannot be overridden because it is not inherited.

What is a private method?

600

This is the output of the following loop:

for (int i = 1; i <= 3; i++) {
    System.out.print(i);
}  

What is 123?

800

These are the two main differences between static and instance variables.

What are shared across all instances vs. belonging to individual objects?

800

This is the output of this code:

int x = 5;
while (x > 0)
{
     x--;
     if (x == 2)
          break;
}
System.out.print(x);

What is 2?

800

This is the output of: 

int[] a = {1,2};
int[] b = a;
b[0] = 99;
System.out.println(a[0]);

What is 99?

800

This method runs when the following code executes: Animal a = new Dog(); a.makeSound();

What is the Dog version of makeSound()?

800

This is the output of the following code:

String word = "java";
System.out.println(word.substring(1, 3));  

What is av?

1000

This issue occurs when a constructor parameter has the same name as an instance variable but doesn’t use `this`.

What is variable shadowing?

1000

This method returns the first multiple of 2 in an int[], or -1 if not found.

What is
for(int n : arr)
     if(n % 15 == 0)
          return n;
     return -1;
?

1000

This is the result of running the method below when passed the array {3, 6, 9}:

public static void reversePrint(int[] arr) {
    for (int i = arr.length - 1; i >= 0; i--) {
        System.out.print(arr[i]);
    }
}

What is 963?

1000

This concept allows objects of different classes to be treated as objects of a common superclass.

What is polymorphism?

1000

This is the output of the following code:

int[] nums = {3, 1, 4};
int sum = 0;
for (int i = 0; i < nums.length; i++) {
    if (nums[i] % 2 != 0) {
        sum += nums[i];
    }
}
System.out.println(sum);

What is 4?

M
e
n
u