Chapter 1
(Introduction)
Chapter 2
(Data Types)
Chapter 3
(Objects & Classes)
Chapter 4
(Conditionals)
Fix This Code
100

This is denoted by /* */

What is a Multiline Comment?

100

The type of variable that cannot be changed.

What is a constant?

100

The code used to get the next integer input from the user.

What is a "scan.nextInt();"?

100

This logical operator is used to check if two values are not equal.

What is a "!="?

100

System.out.println ("Hello World again\n\n" + phrase + "\n\" + new Date() );

System.out.println ("Hello World again\n\n" + phrase + "\n" + new Date() );

200

The escape character sequence used to insert a tab character.

What is a "\t"?

200
The operator used to increase the value of a variable by one.

What is an increment operator or "++"?

200

This holds the address for an object.

What is a reference?

200
This truth table defines the operator


T T - T
T F - F
F T - F
F F - F

What is a "&&" or and?

200

lowerStr = String.toLower(str);

lowerStr = str.toLowerCase();

300

A compiler like that parses through the code line by line.

What is an Interpreter?

300

This is the largest primitive variable that cannot hold decimal points.

What is a Long?
300

The method used to find the first occurrence of a String in another String.

What is a ".indexOf(String_to_Find)"?

300

A conditional statement that parses through multiple values of a condition and runs the block of code on the matching one.

What is a switch statement?

300

Scanner scan = new scan (System.in);
System.out.print ("Input a string of exactly 3 symbols: ");
input = scan.nextLine();

Scanner scan = new Scanner (System.in);
System.out.print ("Input any string:");
input = scan.nextLine();

400

Words that have a special meaning or purpose attached to them, cannot be used as identifier names.

What are Reserved Words?

400

The explicit conversion of one value type to another (regardless of promotion or demotion)

What is Casting?

400

The action of periodically returning the memory allocated to an object back to the system.

What is Garbage Collection?
400

The conditional statement which runs a block of code if the condition is true.

What is an if statement?

400

val1 = scan.nextInt(); // input first value
val2 = scan.nextInt(); // second value
// calculate average
average = val1 + val2 / 2; 

val1 = scan.nextDouble(); // input first value
val2 = scan.nextDouble(); // second value
// calculate average
average = val1 + val2 / 2;

500

The type of error when you divide by 0.

What is a Runtime Error?

500

The correct order of precedence amongst these operators:
%, +(string concatenation), =, /, *, _, +(addition)

What is
* --> / --> % --> +(addition) --> - --> +(string concatenation) --> =

500

The term used to refer to a String for not being able to make change its data.

What is Immutable?

500

A programming construct that allows a block of code to be executed repeatedly until a certain condition is met or it has executed a set number of time.

What is a For Loop?

500

strA = str.substring(4,11); // from index 4 to 11

strA = str.substring(4,12); // from index 4 to 11