Home » JAVA Programming » Applet » Question
  1. Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
    1. global
    2. No modifier is needed
    3. volatile
    4. transient
    5. None of these
Correct Option: C

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.



Your comments will be displayed only after manual approval.