What will be the output of this code?
if (10 > 10){
System.out.println("reached");
}
What is no output?
What are two types of loops in Java?
What are any two of while loops, for loops, and do-while loops?
True or false, public static void main(String[] args) is a method
What is true?
How would you access the "H" element from the array defined by this code?String[] arr = {"W","O","O","H","O","O"};
What is arr[3]?
Which of following pieces of code would print the length of a string called str?
What is System.out.println(str.length());?
What will be the output of this code?
System.out.println(true || false);
What is true?
What will be the output of this code?
int i = 0;
while (i < 5){
System.out.println(i); i++;}
What is?
0
1
2
3
4
How would you call a method named myMethod?
What is myMethod()?
Can you add new elements to an array?
What is no?
How do you create a Scanner variable that reads input from the terminal?
What is Scanner sc = new Scanner(System.in);?
Which comparison operator will return true if two values are not equal?
What is != ?
Which of the following is a valid line of code?
What is for (int j = 0; j < 10; j++) {}?
What data type will this method return?public static int myMethod() {/* code */};
What is int?
What should replace /* REPLACE */ in the following code to create an empty array of 10 integers?
int[] ints = /* REPLACE */;
What is new int[10]?
What are the two common methods for printing out values? No partial credit!
What is System.out.print() and System.out.println()?
Double Jeopardy! This question is worth 2x points.
How do you compare two strings?
What is str1.equals(str2)?
What comparison operator should this loop use to make the loop print the numbers from 0 to 50?
int i = 0;
while (i /*REPLACE OPERATOR*/ 50){
System.out.println(i); i++;}
What is <= ?
What should replace /* REPLACE */ so the method myMethod takes in an integer called x as a parameter?
public static void myMethod(/*REPLACE*/){/*code*/}
What is int x?
Does the following code run without errors?String[] arr = {"WOO","HOO"};System.out.println(arr[2]);
What is no?
Which of the following is an invalid name for a variable in Java?
_BestCoder1stCoderBESTCODERWhat is 1stCoder?
What is the output of this code?System.out.println(true && !(false || true));
What is false?
What will be the output of this code?
for (int i = 0; i < -10; i++){
System.out.println(i);
}
What is no output?
What will this code print out, if anything?
myMethod()
...
public static String myMethod(){
return "Message"
}
What is no output?
What should replace /* REPLACE */ in the following code to print out every element of an unnamed integer array called "arr"?
for (/* REPLACE */){
System.out.println(arr[i]);
}
What is?int i = 0; i < arr.length; i++
Does this code run without errors?
int[] ints = {1, 2, 3};
for(int i : ints) {
System.out.println(i);
}
What is yes?