πŸ“Š JavaScript
Q. The type of a variable that is volatile is
  • (A) Volatile variable
  • (B) Mutable variable
  • (C) Immutable variable
  • (D) Dynamic variable
πŸ’¬ Discuss
βœ… 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.

Explanation by: Official MCQ Buddy

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
203
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
92%
Success Rate