menu

Java Operators

Java Operators - Important Points


21. What is the result of the expression 5 * 2 + 3?

A. 11

B. 13

C. 15

D. 16

Discuss Work Space

Answer: option b

Explanation:

In Java, multiplication and division have higher precedence than addition and subtraction. Therefore, 5 * 2 is evaluated first, resulting in 10. Then, 3 is added to 10 to get the final result of 13.

22. Which of the following operators is used to perform a bitwise AND operation?

A. &

B. &&

C. |

D. ||

Discuss Work Space

Answer: option a

Explanation:

The & operator is used to perform a bitwise AND operation in Java.

23. What is the result of the expression true || false?

A. 1

B. 0

C. 1

D. 0

Discuss Work Space

Answer: option a

Explanation:

The || operator is the logical OR operator. If either of the operands is true, the result is true.

24. Which of the following operators is used to perform a bitwise left shift operation?

A. <<

B. >>

C. &

D. |

Discuss Work Space

Answer: option a

Explanation:

The << operator is used to perform a bitwise left shift operation in Java.

25. What is the result of the expression 10 % 3?

A. 1

B. 2

C. 3

D. 4

Discuss Work Space

Answer: option b

Explanation:

The % operator is used for modulo division, which gives the remainder after division. In this case, 10 divided by 3 leaves a remainder of 1.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now