Why can't volatile and final decorate the same field at the same time?

Why can"t volatile and final decorate the same field at the same time?

Mar.04,2021

volatile ensures that the result is visible to other threads when the variable is written, and final has made it impossible for the variable to be written again.

if you say final an object and change the internal field value of the object, that is not within the scope of the semantics of volatile .

Menu