menu

Java Operators

Java Operators - Important Points


11. What is the result of the expression (2 + 3) * 4?

A. 20

B. 25

C. 14

D. 8

Discuss Work Space

Answer: option b

Explanation:

The parentheses force the addition to be evaluated first, resulting in 5. Then, 5 * 4 is evaluated, resulting in 20.

12. Which of the following is the correct operator for division?

A. +

B. -

C. *

D. /

Discuss Work Space

Answer: option d

Explanation:

The / operator is used for division in Java.

13. What is the result of the expression true && false?

A. 1

B. 0

C. 1

D. 0

Discuss Work Space

Answer: option b

Explanation:

The && operator is the logical AND operator. Both operands must be true for the result to be true, so the result of true && false is false.

14. Which of the following operators is used to compare two values for inequality?

A. !=

B. ==

C. >=

D. <=

Discuss Work Space

Answer: option a

Explanation:

The != operator is used to test for inequality in Java.

15. What is the result of the expression 10 / 3.0?

A. 3.333333

B. 3

C. 4

D. 3

Discuss Work Space

Answer: option a

Explanation:

When at least one of the operands is a floating-point value, the division is performed as floating-point division, resulting in a floating-point value.


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