Assuming we have the following bean:
@Service
public class AccountService {
private String name;
public String sayHello(String name) {
this.name = name;
return "hello, " + this.name;
}
}
In Spring MVC, if several users call sayHello()
method at the same time but pass different parameters, will they get the correct greeting response?
I just want to know will multiple threads modify the same name variable concurrently? Thanks very much!