Java - Thing to know before proceed - Operator Quiz
# | Quiz |
---|---|
1
Discuss
|
Operator
Which of the following can be operands of arithmetic operators?
Solution |
2
Discuss
|
Operator
Modulus operator, %, can be applied to which of these?
Solution |
3
Discuss
|
Operator
With x = 0, which of the following are legal lines of Java code for changing the value of x to 1? 1. x++; 2. x = x + 1; 3. x += 1; 4. x =+ 1;
Solution |
4
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
5
Discuss
|
Operator
Can 8 byte long data type be automatically type cast to 4 byte float data type?
Solution |
6
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
7
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
8
Discuss
|
Operator
Which of these statements are incorrect?
Solution |
9
Discuss
|
Operator
Decrement operator, −−, decreases the value of variable by what number?
Solution |
10
Discuss
|
Operator
Which of these is not a bitwise operator?
Solution |
11
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
12
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
13
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
14
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
15
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
16
Discuss
|
Operator
Which of these statements are incorrect?
Solution |
17
Discuss
|
Operator
Which right shift operator preserves the sign of the value?
Solution |
18
Discuss
|
Operator
On applying Left shift operator, <<, on integer bits are lost one they are shifted past which position bit?
Solution |
19
Discuss
|
Operator
Which operator is used to invert all the digits in a binary representation of a number?
Solution |
20
Discuss
|
Operator
What is the output of relational operators?
Solution |
21
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
22
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
23
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
24
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
25
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
26
Discuss
|
Operator
Which of these statements is correct?
Solution |
27
Discuss
|
Operator
Which of these operators can skip evaluating right hand operand?
Solution |
28
Discuss
|
Operator
Which of the following operators can operate on a boolean variable? 1. && 2. == 3. ?: 4. +=
Solution |
29
Discuss
|
Operator
Which of these is returned by “greater than”, “less than” and “equal to” operators?
Solution |
30
Discuss
|
Operator
What will be the output of the following Java program?
Solution |
31
Discuss
|
Operator
Which of these lines of Java code will give better performance? 1. a | 4 + c >> b & 7; 2. (a | ((( 4 * c ) >> b ) & 7 ))
Solution |
32
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
33
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
34
Discuss
|
Operator
What will be the output of the following Java code?
Solution |
35
Discuss
|
Operator
Which of these statements are incorrect?
Solution |
36
Discuss
|
Operator
What is the order of precedence (highest to lowest) of following operators? 1. & 2. ^ 3. ?:
Solution |
37
Discuss
|
Operator
What is the value stored in x in the following lines of Java code? int x, y, z; x = 0; y = 1; x = y = z = 8;
Solution |
38
Discuss
|
Operator
What should be expression1 evaluate to in using ternary operator as in this line? expression1 ? expression2 : expression3
Solution |
39
Discuss
|
Operator
Which of these have highest precedence?
Solution |
# | Quiz |