'method' vs. 'message' vs. 'function' vs. '???'

后端 未结 11 984
北荒
北荒 2020-12-24 12:59

I recently asked a question about what I called \"method calls\". The answer referred to \"messages\". As a self-taught hobby programmer trying to phrase questions that don\

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 13:55

    Message!=Method!=function

    in OOP different objects may have different methods bound to the same message.

    for example: the message "rotate left n degrees" would be implemented diffrently by diffrent objects such as shape, circle, rectangle and square.

    Messages: Objects communicate through messages.

    -Objects send and recieve messages.

    -the response to a message is executing a method.

    -the method to use is determine be the reciever at run-time.

    In C++ Methods and Messages are called function members.

提交回复
热议问题