Q: The _____ keyword basically says to the JVM "Warning, this variable may be modified in another Thread".
-
A
this
-
B
super
-
C
new
-
D
volatile
D
Answer:
D
Explanation:
The correct option is:
volatile
In Java, the volatile keyword tells the JVM that a variable's value may be modified by multiple threads, ensuring that the most up-to-date value of the variable is always read by the threads.
Related Topic:
Share Above MCQ