Operators - Objective Questions and Answers in Core Java

(1) Evaluate the value of the expression?

6 - 2 + 10 % 4 + 7

[A] 10
[B] 12
[C] 13
[D] 14

Comment

Answer: Option [C]
(2) Which of the following assignment operator does not exist in Java?
[A] >>
[B] %=
[C] >>>
[D] <<

Comment

Answer: Option [D]

The >>> operator does not exist in Java. The other operators are valid.

Examples: x >>=y result is x=x+y

x%=y result is x=x%y

x>>>=y result is x=x>>>y

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

Article and Schedule Quiz Start Test!
(3) What is/are highest order precedence operator(s) in Java?
[A] ( )
[B] { }
[C] both [A] & [B]
[D] None of these

Comment

Answer: Option [C]

Parentheses(), Array subscript{} and Member selection- have the same precedence.

(4) The order of precedence from highest to lowest is :
[A] &&, /, |,{}
[B] %, <=, &&, =
[C] <, !, ==, ++
[D] +, -, [], !=

Comment

Answer: Option [B]
(5) The && and || operators
[A] Combine two numeric values
[B] Compare two boolean values
[C] Combine two boolean values
[D] Compare two boolean values

Comment

Answer: Option [C]

Logical AND(&&) and Logical OR(||) combine two boolean values.

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!

Chapters