Variables
Print Statements
Operations
If-Else Statements
Misc
100

What data type is 'a'?

char

100

What does the '\t' operator do?

It tabs the text

100

What is the value of num?

double num = (7.0 * 3);

21.0

100

Which statement will execute?

if(12 > 13)

{

    //statement 1

}

else

{

     //statement 2

}

statement 2

100

A class is a:

a) method

b) starting point

c) blueprint

d) backdoor

c

200

What values can a boolean variable be?

true or false

200

What will print to the console?

System.out.println("Good"); 

System.out.print("Morning");

Good

Morning

200

What does the '!=' operator mean?

"Not equal to"

200

Which statement will execute?

int x = 14;

if(x <= 14)

{

     //statement 1

}

else

{

     //statement 2

}

statement 1

200

What was java named after?

a) java chips

b) frappuccinos

c) Sun Microsystems

d) coffee

D

300

How many primitive data types are there in java?

8

300

T/F: The cursor ends on the same line after a println statement

False; it ends on the next line

300

What is the value of num?

int x = 40;

int y = 20;

int num = (x-y);

20

300

What will print to the console?

if(4 > 5 || 9 < 10)

{

     System.out.println("true");

}

else

{

     System.out.println("false");

}

true

300

T/F: An if-else statement has a semi-colon at the end of it

False; it is surrounded by curly brackets {}

400

T/F: String is a primitive data type

False; it is a nonprimitive type

400

Where will the cursor end?

System.out.print("Hello\n");

On the next line

400

What is the value of num?

int x = 3;

int num = 9 * x + 3;

30

400

What will print to the console?

int x = 10;

int y = 90 - x;

if(y > 80)

{

     System.out.println("y is greater than 80");

}

else

{     

     System.out.println("y is equal to or less than 80");

}

y is equal to or less than 80

400

Conditions evaluate to the values of which data type?

Boolean; conditions evaluate to true or false

500

What is wrong with the following statement?

int num = 3.0;

3.0 is not compatible with the int data type

500

What will print to the console?

int moneyTotal = 45;

System.out.println("The total amount of money is: $" + moneyTotal + "\nYou have enough!");

The total amount of money is: $45

You have enough!

500

What does the '||' operator mean?

"Or-or"

500

What will print to the console?

int x = 13;

int y = 43;

if((y-x) >= 30 && x < 15)

{

     System.out.println("Welcome");

}

else

{    

     System.out.println("Goodbye");

}

Welcome

500

What does the '.equalsIgnoreCase()' method do?

Checks the values of two strings ignoring the case in which they are in