Sunday, July 21, 2024

operators in Java MCQ

 What is the Java operator used for assigning a value to a variable?

a) =

b) ==

c) :=

d) ->


Which operator is used to compare whether two values are equal in Java?

a) =

b) ==

c) !=

d) ===


What does the '&&' operator represent in Java?

a) Logical OR

b) Logical AND

c) Bitwise OR

d) Bitwise AND


Which operator is used for incrementing the value of a variable by 1 in Java?

a) ++

b) +=

c) --

d) *=


What does the '!' operator do in Java?

a) Bitwise NOT

b) Logical NOT

c) Exclusive OR

d) Unary Minus


Which operator is used to concatenate two strings in Java?

a) &

b) ||

c) +

d) ~


What does the '?:' operator represent in Java?

a) Ternary operator

b) Assignment operator

c) Bitwise operator

d) Unary operator


Which operator is used to perform division and obtain the quotient in Java?

a) %

b) /

c) ÷

d) &


What does the '>>' operator do in Java?

a) Left shift

b) Right shift

c) Bitwise XOR

d) Bitwise AND


Which operator is used to check if a value is greater than or equal to another value in Java?

a) =>

b) =

c) >=

d) ->=


Answers:


a) =

b) ==

b) Logical AND

a) ++

b) Logical NOT

c) +

a) Ternary operator

b) /

b) Right shift

c) >=

No comments:

Post a Comment

git commands MCQ

 Here are some multiple-choice questions (MCQs) on Git commands relevant for Selenium: 1. Which Git command is used to clone a remote reposi...