4. The _____ case is performed by the switch statement if a match is not found
default
first
second
otherwise
Answer:
5. When three relational expressions are joined by OR (||) operators, there must be at least _____ of the relational expressions that evaluate to true for the logical expression to evaluate to true.
one
two
three
none of the relational expressions evaluate to true
Answer:
6. Which of the following items is an acceptable first character in a Java identifier, such as a variable name?
letter
period
semicolon
Answer:
7. When a group of several relational expressions are joined with AND (&&) operators, _____ relational expression(s) must be evaluated to true for the logical expression to be evaluated to true.
one
two
all
none of the relational expressions evaluate to true
Answer:
8. The _____ command allows exiting from a switch statement when a match has occurred.
else
if
case
break
Answer:
9. The language directly executable by a CPU (without translation) is:
bytecode
source code
machine code
Answer:
10. The logical operator || has higher precedence than &&.
true
false
Answer:
11. Which of the following Boolean assignment statements is valid?
boolean a = ‘true’;
b. boolean a = true;
c. boolean a = “true”;
d. boolean a = TRUE;
Answer:
12. Which of the following is NOT a logical operator?
&&
||
%
Answer:
13. The operands of a logical expression must be of type ______
float
long
integer
boolean
Answer:
14. Assuming that the variables are integers, which of the following expressions is not valid?
(a <= B)
(a != B)
(A == B) <= C
(A ==B)
Answer:
15. Java allows assigning a wrong type to a variable by using casting. According to the information given in this class, when assigning a narrow range value to a wider range variable, explicit casting is not needed.
true
false
Answer:
16. If two classes are related to each other through inheritance hierarchy, the child object can access its parent’s private members.
true
false
Answer:
17. Java is a structured language. This means Java uses the following mechanisms to control the execution flow.
Block, loops, and repetition.
Block, selection, and repetition.
Block, selection, if statements.
Answer:
Question4:
The default case is performed by the switch statement if a match is not found |
|
Question5:
When three relational expressions are joined by OR (||) operators, there must be at least one of the relational expressions that evaluate to true for the logical expression to evaluate to true. |
|
Question6:
Letter is an acceptable first character in a Java identifier, such as a variable name? |
|
Question7:
When a group of several relational expressions are joined with AND (&&) operators, all relational expression(s) must be evaluated to true for the logical expression to be evaluated to true. |
|
Question8: | |
The break command allows exiting from a switch statement when a match has occurred. |
|
Question9:
The language directly executable by a CPU (without translation) is: machine code |
|
Question10:
The logical operator && has higher precedence than ||, so the given statement is false. |
|
***Please give Upvote*** |
Get Answers For Free
Most questions answered within 1 hours.