OPERATORS Flashcards

1
Q

What are operators?

A

Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result.

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

What is the operator precedence?

A

See phone for pic

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

What is an assignment operator?

A

’=’
• Its purpose is to assign the value on its right to the operand on its left. E.g.
• int marks = 0;

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

What is concatenation?

A

‘Adding’ two strings

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

What are unary operators?

A
  • The unary operators require only one operand.
  • They perform various operations such as incrementing/decrementing a value by one, negating an expression, or inverting the value of a boolean.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the three conditional operators?

A
  • && Conditional-AND
  • || Conditional-OR
  • ?: - shorthand for an if-then-else statement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the bitwise and bit shift operators?

A

1.The unary bitwise complement operator “~” inverts a bit pattern; making every “0” a “1” and every “1” a “0”.

2.The signed left shift operator “<>” shifts a bit pattern to the right. The bit pattern is given by
the left-hand operand, and the number of positions to shift by the right-hand operand.

3.The unsigned right shift operator “»>” shifts a zero into the leftmost position, while the leftmost position after “»” depends on sign extension.

  1. The bitwise & operator performs a bitwise AND operation.
  2. The bitwise ^ operator performs a bitwise exclusive OR operation.
  3. The bitwise | operator performs a bitwise inclusive OR operation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is The Type Comparison Operator instanceof

A
  • The instanceof operator compares an object to a specified type.
  • One can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

List all the types of operators

A
  1. Assignment Operators
  2. Arithmetic Operators
  3. Unary Operators
  4. Equality/Relational Operators
  5. Conditional Operators
  6. Bitwise Operators
  7. Bit Shift Operators
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The do while asterisk thing

A

*see doc

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