Question: Question 1 In Java, case and switch are reserved words, but break is not a reserved word. T True F False Question 2 ' A

Question 1
In Java, case and switch are reserved words, but break is not a reserved word.
T
True
F
False
Question 2
'A'<'a' && 4<=8||2.5>=7||4< y
Based on the code above, which part of the expression is not evaluated?
2.5>=7
4< y
2.5>=7||4< y
4<=8
Question 3
Which of the following is NOT a relational operator in Java?
<>
<=
==
>
Question 4
'A'<'a' && 4<=8||2.5>=7||4< y
What is the value of the expression above?
true
false
x
It cannot be determined.
Question 5
Including a semicolon before the action statement in a one-way selection causes a syntax error.
T
True
F
False
Question 6
Suppose str1 and str2 are String variables. The expression (str1== str2) determines whether str1 and str2 point to the same String object.
T
True
F
False
Question 7
Which of the following will cause a syntax error?
(10< num) && (num <30)
10< num <20
10< num && num <25
num >10 && num <40
Question 8
The symbol >= is a logical operator.
T
True
F
False
Question 9
Suppose that you have the following code:
int sum =0;
int num =8;
if (num <0)
sum = sum + num;
else if (num >5)
sum = num +15;
After this code executes, what is the value of sum?
0
8
15
23
Question 10
A computer program will recognize both = and == as the equality operator.
T
True
F
False
Question 11
The operators = and == have the same order of precedence.
T
True
F
False
Question 12
Suppose x =10 and y =20. The value of the expression ((x >=10) && (y <=20)) is true.
T
True
F
False
Question 13
Which of the following will cause a syntax error, if you are trying to compare x to 5?
if (x ==5)
if (x =5)
if (x <=5)
if (x >=5)
Question 14
=! is a relational operator.
T
True
F
False
Question 15
What does >= mean?
less than
greater than
less than or equal to
greater than or equal to
Question 16
The execution of a break statement in a switch statement terminates the switch statement.
T
True
F
False
Question 17
Which of the following is a relational operator?
=
==
!
&&
Question 18
In Java, !, &&,and || are called logical operators.
T
True
F
False
Question 19
If str1 is Hello and str2 is Hi, which of the following could not be a result of str1.compareTo(str2);?
-9
-5
-1
1
Question 20
int x;
x =(1<=3 && 'K'>='F')?5 : 12
Based on the code above, what is the value of x?
1
3
5
12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!