parameter与argument,property与attribute

本文摘自:https://blog.csdn.net/Zhangxichao100/article/details/59484133

parameter与argument,property与attribute这四个词是不一样的,其实还有一个variable这个词最后聊

一、parameterargument

parameter:参数(形参)
argument:参数(实参)

至于实参和形参的差别就不介绍了。

二、propertyattribute

property : 性质
attribute : 属性

一般称只是在类内部使用,不对外的属性为 Attribute
也有一些属性虽然是 private的,但是会提供相应的 getter/setter 方法让外部来操作,把这些属性称为Property

三、variable

这个词单纯的说明一个量是常量(constant)还是变量(variable)

posted @ 2019-12-22 20:57  手握钢叉的猹  阅读(533)  评论(0编辑  收藏  举报