I am having a method that is accessed by multiple threads in the java program.This method have:
- Global object variables
- Local variable
- Formal Parameters.
Now this method is not synchronized so when the multiple threads changes the value of above three types of variables then will these changes reflected in other threads or each thread will have separate copy of these variables.
Global object : Will reflect changes
Local variable : Will not
Formal Parameters: Object references Will reflect changes and parameter of primitive type will not reflect changes.