Sail E0 Webinar
Question
Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
Options:
A .  transient
B .  volatile
C .  global
D .  No modifier is needed
Answer: Option B


The volatile modifier tells the compiler that the variable modified by volatile can be changed unexpectedly by other part of the program. Specially used in situations involving multithreading.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers