OOPs Interview Question and Answers
16. |
Define Operator and Operand. |
|
Operator- An operator is a symbol that tells the computer to perform certain mathematical or logical manipulations.
- It is used to manipulate data and variables.
Operands-
The data items that the operators act upon are called operands.
|
|
|
17. |
What is called ternary operator? |
|
- The ternary operator is used to form a conditional expression.
- It uses three operands and hence it is called as a ternary operator.
- The general format is:
- expression1? expression2: expression3
|
|
|
18. |
What is the use of lock statement? |
|
- The lock statement is used to implement the mechanism of mutual exclusion of critical sections.
- An object is locked until it completes the execution of its embedded statement and then the lock is released
|
|
|
19. |
What is checked and Unchecked Operator? |
|
- These operators are used in arithmetic operations for overflow checking.
- If an operation is checked, and over flow error will be thrown when an over flow occurs.
- If it is not checked, the error is not reported and the overflowing bits are discarded.
|
|
|
20. |
List out the Special Operators in C#. |
|
- is, as - relational operator
- type of - type operator
- size of - size operator
- new - object creator
- .(dot) - member access operator
- checked - overflow checking
- unchecked - prevention of overflow checking.
|
|
|
123456789101112
Page 4 of 12