Operators Flashcards

1
Q

What are ‘operators’ in Java?

A

Operators are used to perform operations on variables and values.

The value is called an operand, while the operation (to be performed by the two operators) is defined by an operator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the different types of operators in Java?

A

Arithmetic operators: used to perform common mathematical operations.

Assignment operators: used to assign values to variables.

Comparison operators: used to compare two values.

Logical operators: Determine the logic between variables or values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the Arithmetic operators?

A

Ans:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the Assignment operators in Java?

A

Ans:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the Comparison operators?

A

Ans:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the Logical operators?

A

! (Not) - Returns true if the operand to the
right evaluates to false. Returns false if the operand to the right is true.

&& (Conditional and) - Same as &, but if the operand on
the left returns false, it returns false without evaluating the operand on the right.

|| (Conditional or) - Same as |, but if the operand on the
left returns true, it returns true without evaluating the operand on the right.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly