One . Stateless

We all know that when only multiple threads access common resources , Data security issues may arise , So if we don't have public resources , Is there no such problem ?
public class NoStatusService { public void add(String status) {
System.out.println("add status:" + status); } public void update(String status)
{ System.out.println("update status:" + status); }}
Two . Immutable

If multiple threads access common resources, it is immutable , There will be no data security issues .
public class NoChangeService { public static final String DEFAULT_NAME =
"abc"; public void add(String status) { System.out.println("add status:" +
status); }}
Three . Secure release

If there are public resources in the class , However, it has no access to the outside world , That is, external security release , There is no thread safety issue
public class SafePublishService { private String name; public String getName()
{ return name; } public void add(String status) {

Technology