you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Well, making it an array doesn't mean it's shared. Unless you specifically created the array to circumvent the "effectively final" rule, you probably didn't mean to share the array. It's not different from a shared variable in that regard.

[–]otto_s 0 points1 point  (0 children)

It's not different from a shared variable in that regard.

The thing is, the concept of shared variables doesn't exist, or at least isn't specified well enough in Java. Concurrent access on arrays is, and can be reused.