In Java is there a name for the object the method is called on?

java, objective-c

Solution

That's called the "receiver". See Terminology.

Problem

When I explain code, I often have to write "the object that the method is called on". E.g. The `contains()` method simply checks if the input substring is present in the string you call the `contains()` on. In Objective-c I'd write The `contains()` method simply checks if the input substring is present in receiver (string). Which makes sense as Objective-c uses message passing and a message has a sender and a receiver. The lack of this expression for Java terminology makes descriptions very complicated when the object in question cannot be named explicitly. Does there exist a standard name for the object that the method is called on? VERDICT: receiver seems to express the relationship the best.

Original source