Operators and Assignments Questions and Answers
Practice ModeShowing 10 of 38 questions
Q31
What is the result of !(5 > 3 && 2 < 1)?
Answer: Option A
Explanation: Inner: (true && false) -> false, !false = true.
Q32
What does a >>> 2 perform?
Answer: Option B
Explanation: >>> shifts right without sign extension.
Q33
What is the value of byte b = (byte) 130;?
Answer: Option B
Explanation: 130 overflows byte (range -128 to 127): wraps to -126.
Q34
What is the size of the boolean type?
Answer: Option C
Explanation: JVM does not specify bit size for boolean storage.
Q35
What is printed?System.out.println(10 == 10.0);
Answer: Option A
Explanation: int 10 promoted to double -> values equal.
Q36
Which of these is not a valid assignment?
Answer: Option B
Explanation: char uses single quotes ''''a'''', not double quotes.
Q37
System.out.println(7 >> 1);
Answer: Option A
Explanation: Right shift divides by 2: 7 >> 1 = 3.
Q38
int a = 5; int b = 2; double c = a / b; What is c?
Answer: Option B
Explanation: Integer division gives 2; stored as 2.0 in double.