Question: 6 -
Select from among the following character escape code which is not available in Java.
-
\t
-
\a
-
\\
-
\v
Answer:
\a
Solution not available.
Question: 7 -
Evaluate the value of the expression?6 - 2 + 10 % 4 + 7
-
14
-
10
-
12
-
13
Answer:
13
Solution not available.
Question: 8 -
Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
-
1 < x < 100 || x < 0
-
((x < 100) && (x > 1)) && (x < 0)
-
((x < 100) && (x > 1)) || (x < 0)
-
(1 > x > 100) || (x < 0)
Answer:
((x < 100) && (x > 1)) || (x < 0)
Solution not available.
Question: 9 -
The && and || operators
-
Combine two boolean values
-
Compare two numeric values
-
Compare two boolean values
-
Combine two numeric values
Answer:
Combine two boolean values
Solution:
Logical AND(&&) and Logical OR(||) combine two boolean values.
Logical AND(&&) and Logical OR(||) combine two boolean values.
Question: 10 -
What is/are highest order precedence operator(s) in Java?
-
{ }
-
Both A & B
-
None of these
-
( )
Answer:
Both A & B
Solution:
Parentheses(), Array subscript{} and Member selection- have the same precedence.
Parentheses(), Array subscript{} and Member selection- have the same precedence.