What data type is 'a'?
char
What does the '\t' operator do?
It tabs the text
What is the value of num?
double num = (7.0 * 3);
21.0
Which statement will execute?
if(12 > 13)
{
//statement 1
}
else
{
//statement 2
}
statement 2
A class is a:
a) method
b) starting point
c) blueprint
d) backdoor
c
What values can a boolean variable be?
true or false
What will print to the console?
System.out.println("Good");
System.out.print("Morning");
Good
Morning
What does the '!=' operator mean?
"Not equal to"
Which statement will execute?
int x = 14;
if(x <= 14)
{
//statement 1
}
else
{
//statement 2
}
statement 1
What was java named after?
a) java chips
b) frappuccinos
c) Sun Microsystems
d) coffee
D
How many primitive data types are there in java?
8
T/F: The cursor ends on the same line after a println statement
False; it ends on the next line
What is the value of num?
int x = 40;
int y = 20;
int num = (x-y);
20
What will print to the console?
if(4 > 5 || 9 < 10)
{
System.out.println("true");
}
else
{
System.out.println("false");
}
true
T/F: An if-else statement has a semi-colon at the end of it
False; it is surrounded by curly brackets {}
T/F: String is a primitive data type
False; it is a nonprimitive type
Where will the cursor end?
System.out.print("Hello\n");
On the next line
What is the value of num?
int x = 3;
int num = 9 * x + 3;
30
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
Conditions evaluate to the values of which data type?
Boolean; conditions evaluate to true or false
What is wrong with the following statement?
int num = 3.0;
3.0 is not compatible with the int data type
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!
What does the '||' operator mean?
"Or-or"
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
What does the '.equalsIgnoreCase()' method do?
Checks the values of two strings ignoring the case in which they are in