Multiple choice

Which of the following statements is/are correct about volatile variables?

  1. These variable are used to save an object into a file.

  2. The thread will read the most recent updated value by using volatile variable.

  3. It is used to create variables and methods that will exist independently of any instances created for the class.

  4. Volatile variables are used in asynchronous medium.

  5. Both (2) and (4)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

.