Are they the same if we just considered the get/set methods? Or to say, are the following two pieces of code equivalent?
private volatile boolean a;
public boolean isA(){
return a;
}
public void setA(boolean a){
this.a = a;
}
private AtomicBoolean a;
public boolean isA(){
return a.get();
}
public void setA(boolean a){
this.a.set(a);
}