Thursday, 15 January 2015

java - Can a thread-safe class contain any public instance fields? -


Can any thread-protected class include the public instance field?

Access modifiers are irrelevant in this context of thread-protection. Of course, you can use a public field in a thread safe class You may need to ask yourself the question: Is it compatible with my / design pattern and what can I achieve by doing so?


No comments:

Post a Comment