For an example, if we have some variable in run method, and
we created one or more threads. Does all threads will share
the same variable or a copy of variable is created for each
thread??
Answer / ranganathkini
No, each thread will have its own copy of the variable.
The reason is that run() is a method and any variable
declared inside a method is considered a local method and
its scope remains only within that method. If new thread
instances are spawned then each thread instances' run()
method will have their own copy of the variable.
Is This Answer Correct ? | 3 Yes | 0 No |
difference between applicationserver and webserver
What exceptions are thrown by RMI?
What are the different algorithms used for clustering?
What is the purpose of the notify() method?
What is Bootstrapping in RMI?
Which Taglibraury you used in your project? plz send me ans....which we r using generally
Difference Between getRequest and PostRequest?
What is serialization and de-serialization ?
difference between ejb,struts,hibernate,spring and jsp
what are the advantages of JTA over JTS?
Do we need to override service() method
Why do I get a duplicate name error when loading a jar file?