Java Basics
Variables and Data Types
Expressions
Compound Assignments
Casting
100

String literals are enclosed by these special characters

"What are double quotes?"

100

A name associated with a memory location in the computer

What is a variable?

100

What is the final value of z?

What is 3?

100

This operator can be used to shortcut

x=x-1;

What is x--; or x-=1; ?

100
This operation will create a temporary value converted to a decimal number
What is (double)?
200

These methods are used by programs to display information to the computer monitor (or a console)

What are System.out.print() and System.out.println() ?

200

A value that a boolean variable can store

What is true or false?

200

What does the console display?

System.out.println(158 % 10);

What is 8?

200

What is the final value of x?

int x = 32;

x /= 6;

What is 5?
200

What does this output?

System.out.println((double) 1 / 3);

What is 0.33333?

300

This type of error is reported if the Java code is not correctly written.

What is a syntax error?

300

This type is used to declare a variable that is a real number.

What is a double?

300

What does the console display?

System.out.println(3 % 400);

What is 3?

300

What is the final value of x?

int x = 5;

x %= 10 * 2;

What is 5?

300

What does this output?

System.out.println((double) (1 / 3));

What is 0.0?

400

Every Java program starts with this.

A public class declaration

e.g. public class MyClass

400

The two types of variables in Java are primitive and this type

What is an object variable?

400

What does the console display?

System.out.println("The number is: " + 3 + 3);

What is "This number is: 33"?

400

The final value of x, y, and z

int x = 3;
int y = 5;
int z = 2;
x *= 4;
y -= 3;
z += y;

What is x = 12, y = 2, z = 4?

400

What the computer does when you perform integer division and part after the decimal point is thrown away.

What is truncate?

500

This program translates Java code into a class file that can be run on your computer.

What is a compiler?

500

Coding challenge

Write a line of code that creates a variable called ringsToRuleThemAll and sets it to the appropriate value. 

int ringsToRuleThemAll = 1;

500

What does the console display?

What is 10.0?

500

The final value of x, y, and z

int x = 3;
int y = 5;
int z = 2;
x *= z * 2;
y /= y / 2;
z++;

What is x = 12, y = 2, z = 3?

500

The effect of performing this operation.

(int)(x + 0.5)

What is round to the nearest positive number?