hese annotations will be first processed by a program called annotation processor that can read a Java program and take actions based on its annotations.
This metadata is used by the IDE, compiler and JVM (depending upon scope\retaintion policy of annotation) to extract additional information about class and attributes.
Mike Simmons wrote:I'd say it's achieved by virtue of the fact that nothing prevents it from happening. In general, threads can execute any code you tell them to.
Did you mean to ask how synchronized blocks or locks can be reentrant? That's a different meaning of reentrant than the one you gave.
Pat Farrell wrote:Since its widely known that "Singletons considered dangerous", why are you having 1000 threads beat on a singleton? Perhaps one can argue that a singleton is acceptable for near-constant data, but why are you calling methods in the singleton?
There are far better patterns to use than a singleton, such as a factory that only creates one instance.