[SV LRM 2017] local variable of class which can be accessed only by 1 handle

As per LRM, class having local variables can be accessed by handle of that type and also we can compare local variables inside that class. I developed This. here 2 handle points to one object and they both are able to modify that, Is there way we can restrict usage of local variable of class being access only by 1 handle?(like here p2 can not point to p1 and modify object’s values)

In reply to juhi_p:

What you have is 2 class variables holding the same class handle which refers to the same class object. There’s no way to know which class variable was used to invoke the method, and there’s probably no need to know.

The compare() method uses two handles, so you could check
(this != other)
for the compare() to succeed.