Java: Chapter 2 Review Questions and
Answers| Latest Update
Which type of variable can hold the value 'true' or 'false': ✔️✔️boolean
What are two data type variables that can hold values with decimals: ✔️✔️float or double
An escape sequence always begins with a(n): ✔️✔️backslash
Which is a correct statement to prompt the program to output a line: ✔️✔️System.out.println();
According to the rules of operator precedence, when division occurs in the same arithmetic
statement as __________, the division operation always takes place first. ✔️✔️subtraction
The "equal to" relational operator is: ✔️✔️==
When you perform arithmetic with values of diverse types, Java: ✔️✔️implicitly converts the
values to a unifying type
What do you use to explicitly override an implicit type: ✔️✔️type cast
Example of a correct assignment statement for a character data type: ✔️✔️char aChar = '*';
Which assignment is correct in Java? ✔️✔️a) Double money= 12;
b) Double money= 12.0;
c) Double money= 12.0d;
All of the above are correct(answer):
Answers| Latest Update
Which type of variable can hold the value 'true' or 'false': ✔️✔️boolean
What are two data type variables that can hold values with decimals: ✔️✔️float or double
An escape sequence always begins with a(n): ✔️✔️backslash
Which is a correct statement to prompt the program to output a line: ✔️✔️System.out.println();
According to the rules of operator precedence, when division occurs in the same arithmetic
statement as __________, the division operation always takes place first. ✔️✔️subtraction
The "equal to" relational operator is: ✔️✔️==
When you perform arithmetic with values of diverse types, Java: ✔️✔️implicitly converts the
values to a unifying type
What do you use to explicitly override an implicit type: ✔️✔️type cast
Example of a correct assignment statement for a character data type: ✔️✔️char aChar = '*';
Which assignment is correct in Java? ✔️✔️a) Double money= 12;
b) Double money= 12.0;
c) Double money= 12.0d;
All of the above are correct(answer):