I want to compare if an variable A represents the same object as variable B does.
Could I do that with the == operator?
Or what else is this exactly looking
The two other answers correctly answer the question in your title. The correct answer to the completely different question in your body text, however, is: yes, the == operator is correct for testing whether two variables refer to the same object.