Q. The type of a variable that is volatile is
β
Correct Answer: (B)
Mutable variable
Explanation:
A volatile variable refers to a variable whose value can change unexpectedly due to external factors such as hardware changes, multi-threading, or signal handlers. Such variables are typically mutable, meaning they can be modified during program execution.
Other options:
- (A) Volatile variable β While "volatile" is a keyword in some languages like C and Java, it does not define a variable type; rather, it is a qualifier.
- (C) Immutable variable β Incorrect, as immutable variables cannot change once assigned.
- (D) Dynamic variable β This usually refers to variables that are allocated dynamically in memory but does not specifically relate to volatility.
Thus, the correct answer is (B) Mutable variable.