menu

Java Operators

Java Operators - Important Points


26. Which of the following operators is used to compare two values for less than or equal to?

A. !=

B. ==

C. >=

D. <=

Discuss Work Space

Answer: option d

Explanation:

The <= operator is used to test if the left operand is less than or equal to the right operand.

27. What is the result of the expression "Hello" + "World"?

A. Hello World

B. HelloWorld

C. Hello+World

D. HelloWorld!

Discuss Work Space

Answer: option b

Explanation:

The + operator is used to concatenate strings in Java.

28. Which of the following operators is used to perform a bitwise OR operation?

A. &

B. &&

C. |

D. ||

Discuss Work Space

Answer: option c

Explanation:

The | operator is used to perform a bitwise OR operation in Java.

29. What is the result of the expression 5 / 2?

A. 2.5

B. 2

C. 2

D. 3

Discuss Work Space

Answer: option b

Explanation:

When both operands of the / operator are integers, the division is performed as integer division, resulting in an integer value.

30. Which of the following operators is used to perform a logical negation operation?

A. !

B. ~

C. +

D. -

Discuss Work Space

Answer: option a

Explanation:

The ! operator is used to perform a logical negation operation in Java. It returns true if the operand is false, and false if the operand is true.


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