These are two atomic operations:

```
int value = 5;
Object obj = new Object();

```

But when using a primitive as a method parameter, would this be considered as an atomic operation:
`public void setValue(int val, Object obj){  

 this.value = val; // Atomic?  

 this.obj = obj; // Not atomic?  

}`

?
The copy of the object reference is not atomic since it includes a read and a write, right?

Would it be correct to say that the only way to make an atomic operation on an object reference is to declare it null or assign a new object to it, like:

```
Object obj = null;

```

and

```
Object obj = new Object();

```

?