Why make a method volatile in java?

后端 未结 7 1225
逝去的感伤
逝去的感伤 2020-12-15 06:23

Why would a method be made volatile? How does making a method volatile change the method\'s behavior?

Edit: I did a toString() on a Method object r

7条回答
  •  情书的邮戳
    2020-12-15 06:49

    have you read

    http://jeremymanson.blogspot.com/2008/11/what-volatile-means-in-java.html


    just to make the answer complete :

    as everybody else is pointing out : you can't make a method volatile.

提交回复
热议问题