Java General
Variable Types
Loops
Arrays & Strings
Misc. / Trivia
100

This keyword is used to create a new object from a class

What is new?

100

This variable type stores whole numbers

What is int?

100

This loop is best when you know exactly how many times something should repeat

What is a for loop?

100

This method tells you how many characters are in a String.

What is .length()?

100

This punctuation mark appears at the end of most java statements

What is a semicolon?

200

A command that prints text to the console and moves to the next line

What is System.out.println()?

200
This variable type stores true or false

What is boolean?

200

The amount of times this loop will run:
for(int i = 0; i <= 4; i++)

What is 5?

200

The index that is the first element of every Java array

What is 0?

200

This symbol denotes a comment

What is //?

300

This is the name of the method where every Java program starts

What is main?

300
This variable type stores one single character

What is char?

300

This loop keeps running as long as a condition remains true

What is a while loop?

300

This is what the code will print:

String word = "Computer";

System.out.println(word.charAt(2));

What is 'm'?

300

This is how many strings a standard violin has

What is 4?

400

This is what's wrong with this code:

System.out.println('Hello')

What is: should be double quotations instead of single quotations?

400

This is the variable type you should use to store 3.14

What is double?

400

This is what this loop will print:

for(int i = 1; i <= 3; i++) 

{    

     System.out.print(i); 

}

What is 123?

400

This is the printed output:

int[] nums = {5, 8, 2};

System.out.println(nums[1]);

What is 8?

400

This is a method inside a class that gives you access to private variables

What is an accessor method?

500

This is what || represents

What is or?

500

This is the variable type that should be used to store a person's name

What is String?

500

This is how many times this loop runs:

for(int i = 2; i <= 10; i = i+2)

What is 5?

500

This is what is printed:

String word = "banana";

System.out.println(word.indexOf("n"));

What is 2?

500

This is the error in the following code:

if(x = 5)
{
    System.out.println("Hi");
}


What is = should be ==?