go top

protected access methods

网络释义

  保护域中的访问方法

规则18:保护域中的访问方法(Protected Access Methods) 在基类中将组件参照放置在私有域中,而为这些组件添加一些访问函数来得到他们的属性,这将是一种更好的方法。

基于12个网页-相关网页

有道翻译

protected access methods

受保护的访问方法

以上为机器翻译结果,长、整句建议使用 人工翻译 。

双语例句

  • When fields are declared protected, there is the possibility that methods in subclasses will directly access them, effectively increasing the coupling within a class hierarchy.

    将字段声明为受保护时,子类中的方法就有可能直接访问它们,这样就可能有效地增加类层次结构中的耦合。

    youdao

  • The first and most important addition was access protection for methods and instance variables on classes -- the public, protected, and private keywords.

    第一个也是最重要的新特性是针对类的方法和实例变量的访问保护 —— public、protected 和 private 关键字。

    youdao

  • That's why the Vehicle class, and its subclasses, have either private or protected fields, and public setter and getter methods to provide access.

    这也正是 Vehicle 类及其子类都具有 private 或者 protected 属性,而用 public setter 和 getter 方法来访问属性的原因。

    youdao

更多双语例句
$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定