Why aren't variables in Java volatile by default?

后端 未结 6 1635
夕颜
夕颜 2020-12-30 07:05

Possibly similar question:

Do you ever use the volatile keyword in Java?


Today I was debugging my game; It had a very difficult threading problem that w
6条回答
  •  一向
    一向 (楼主)
    2020-12-30 07:29

    Personally I think fields should have been final by default and mutable only with an extra keyword, but that boat has sailed along time ago. ;)

提交回复
热议问题