access specifier是什么意思

如题所述

access specifier

[计] 存取说明符

访问说明符;存取规范;访问指示符;存取说明符
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-08-29
例如:
<access specifier> class class_name
{
// member variables
<access specifier> <data type> variable1;
<access specifier> <data type> variable2;
...
<access specifier> <data type> variableN;
// member methods
<access specifier> <return type> method1(parameter_list)
{
// method body
}
<access specifier> <return type> method2(parameter_list)
{
// method body
}
...
<access specifier> <return type> methodN(parameter_list)
{
// method body
}
}

访问标识符 <access specifier> 指定了对类及其成员的访问规则。如果没有指定,则使用默认的访问标识符。类的默认访问标识符是 internal,成员的默认访问标识符是 private。
数据类型 <data type> 指定了变量的类型,返回类型 <return type> 指定了返回的方法返回的数据类型。
如果要访问类的成员,你要使用点(.)运算符。
点运算符链接了对象的名称和成员的名称
相似回答