General
Looping
Branching
Methods
Boolean/Packages
100

What is concatenation? How is it different from the + operator? When does it know to do + and when does it concatenation? 

To merge together two Strings or variables for an output. The + operator does actual arthritic addition. It knows once it encounters a String, it considers the rest of the expression as a String  

100

What are the three looping statements?

Do,Do-while,for loops

100

What are the four branching statements?

if, else, else-if, switch 

100

What is the method to take an integer from the user?

.nextInt();

100

What is a boolean?

True/False

200

Give an example of a declared constant that is an integer

public static final int DAYS_IN_WEEK = 7;

200

When would you use a for loop?

When you know how many times you would want to run the loop for

200

What happens if you forget the break in a switch statement?

It will continue doing every case until the code finds a break in the switch statement.

200

What does the .length() method return?

the number of characters in a String

200

    int num = 0;

    boolean condition = false;

    if(num == 0){

      condition = true;

    }

    System.out.print(condition);

true

300

What type of coding language is Java?

High-level object oriented programming

300

What will happen if the Boolean condition is never true in a loop? 

Infinite loop

300

What does System.exit(0); do?

exits current program/stops running the code

300

What does .substring(start index, end index) do? What happens if you just have a start index in the parameters?Which index is inclusive and which index is exclusive?

returns a new string that is a sub string of given string. If you just have the start index in the parameters, then it will create a new string from the start index to the end of the string. The start index is inclusive and the end index is exclusive.

300

What is the output of the following code?    

int num = 0;

    boolean condition = false;

    if(num != 0){

      condition = true;

    }

    System.out.print(condition);


false

400

What is the file extension for Java source code? What is the file extension for Java byte code?

.java  / .class

400

What does it mean if a loop is post-test? What loop is a post-test loop?

It means it runs the code once, then checks if the if the Boolean statement is true. A do-while is a post test loop

400

What type of condition do you need when you're trying to use a branching?

a Boolean condition

400

What is the method we need to invoke to read a string from the user?

.nextLine();

400

What packages do you have to import to use the Scanner and RandomGenerator? What package do you need to import to use Decimal Format?

java.util.Scanner;

java.text.DecimalFormat;

500

What is the header for your main method?

public static void main(String[] args) {

500

What type of variable is i in this for loop, (int i = 0; i>10;i++)

Local variable

500

What is the output of the following code?

for (int n= 1; n<= 3; n++) {

switch(n){

case 1:

System.out.println("First");  

case 2:

System.out.println("Second");

break;

case 3:

System.out.println("Third");

break; 

default: 

System.out.println("Default Case");

  }

 }

}

}

First

Second

Second

Third

500

What is the method that will check for equality of two Strings, while ignoreing if there is differences in the casing?

.equalsIgnoreCase()

500

What are the symbols that match with these boolean operators?:

AND, OR , EQUALS, NOT , NOT EQUALS

&&,  ||  ,  == ,  !  ,  !=

M
e
n
u