我在解释代码的时候,经常要写“方法被调用的对象”。例如。
The
contains()
method simply checks if the input substring is present in the string you call thecontains()
on.
在 Objective-c 中我会写
The
contains()
method simply checks if the input substring is present in receiver (string).
这是有道理的,因为 Objective-c 使用消息传递并且消息有发送者和接收者。
当所讨论的对象无法明确命名时,Java 术语缺少此表达式使得描述变得非常复杂。 调用该方法的对象是否存在标准名称?
VERDICT:接收者似乎最能表达这种关系。
最佳答案
这就是所谓的“接收器”。参见 Terminology .
关于java - 在 Java 中是否有调用方法的对象的名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18445897/