Single Choice Easy

QThe _____ keyword basically says to the JVM "Warning, this variable may be modified in another Thread".

ID: #22938 TCS Core Java Questions 184 views
Question Info
#22938Q ID
EasyDifficulty
TCS Core Java QuestionsTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A this
  • B super
  • C new
  • D volatile
Correct Answer

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.

Share This Question

Challenge a friend or share with your study group.