What is the purpose of the 'volatile' keyword in Java when applied to a variable? - Study24x7
Social learning Network
13 Mar 2024 10:33 AM study24x7 study24x7

What is the purpose of the 'volatile' keyword in Java when applied to a variable?

A

It ensures atomicity for operations on the variable.

B

 It prevents the variable from being modified.

C

It ensures visibility of changes made by one thread to other threads. 

D

It specifies that the variable cannot be accessed by multiple threads.

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles