Basics
Control Structures
Methods
Strings
Arrays
100

This data type holds true or false values

What is a boolean?

100

boolean done = false;

if(!done)

    System.out.println("Yea");

else

    System.out.println("Nah");


What is Yea?

100

What is the return type of 

public static void printNumber(int x) ?

What is void?

100

String word = "frenzy!";

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

What is ! ? 

100

String [ ] veggies = {"celery","carrots","mushrooms","peppers"};

System.out.println(veggies.length);


What is 4?

200

This is 27 % 8

What is 3? 

200

int x = 17;

int y = -3;

boolean huh = y <= x && x != y;

System.out.println(huh);

What is true?
200

This method is used to control the order of commands in a running program.

What is the main method?

200

int num = "abc".indexOf("z");

System.out.println(num);

What is -1 ?

200

String [ ] veggies = {"celery","carrots","mushrooms","peppers"};

System.out.println(veggies[2]);

What is mushrooms?


300

int x = 11;

String animal = "dog";

System.out.println("I have " + x + " " + animal + "s!");

What is I have 11 dogs!

300

What is the error in the code segment?

Scanner kb = new Scanner(System.in);

System.out.println("Enter a number");

int x = kb.nextLine( );

What is nextLine( )?

300

This is the parameter list of:

public static double doSomething(int x; String y)

What is int x and String y? 

300

String fruit = "banana";

System.out.println(fruit.substring(1,4));

What is ana ?

300

int [ ] pi = {3, 1, 4, 1, 5, 9, 2};

for(int i = 0; i < 4; i++)

   System.out.println(pi[i]);

What is 3141?

400

System.out.println(5/10);

What is 0?

400

This nested loop runs that many times:

for(int i = 0; i < 5; i++)

    for(int j = 0; j < 7; j++)

                System.out.println("*");


What is 35?

400

This command is a random number from 3 to 7

What is (int)(Math.random( ) * 5) + 3

400

String greeting = "hi";

String other = "high";

greeting += "gh";

System.out.println(greeting.equals(other));

What is true?

400

boolean [ ] truths = new boolean [7];

for(int i = 0; i < truths.length; i += 2)

   System.out.print("*");

What is **** ?

500

System.out.println("" + 5 + 2);

What is 52?

500

int x = 5;

while(x < 7)

{

    System.out.println("???");

}

What is an infinite loop?

500

This is a method that takes in a double and rounds the value to the nearest hundredth place.

What is 

public static double roundNearest(double x)

{

     return Math.round(x * 100) / 100.0; 

}

500

String word = "knickknack";

String newWord = "";

for(int x = 0; x < word.length(); x++) {

    if (word.charAt(x) == 'k')

           newWord += '$';

     else

         newWord += word.charAt(x);

}

System.out.println(newWord);


What is $ni$$nac$ ?

500

String [ ] veggies = {"celery","carrots","mushrooms","peppers"};

System.out.print(veggies[3].substring(0,4) + " ");

System.out.print("in my step!");

What is pep in my step! ?

M
e
n
u