
英:/''ɡetə/ 美:/'ˈɡetər/
n. 吸气剂;获得者;毒饵
vt. 消气;用吸气剂去除
vi. 使用杂质吸收剂
Not throw an Exceptions (getter).
不要抛出异常(getter)。
Add a getter and setter for the id attribute.
为id属性添加一个获得者以及设置者。
Not be used to perform a conversion (getter).
不要被用作转换(getter)。
In Struts 2 you use getter and setter methods.
Struts 2中使用getter和setter方法。
Never return an array or a cloned list (getter)
永远不要返回一个数组,或者一个克隆的列表(getter)
n.|gainer;[真空][助剂][电子]吸气剂;获得者;毒饵
我将基于通用知识解释单词“getter”的含义:
编程术语(主要含义)
在面向对象编程中,getter 是一种用于获取对象私有属性值的方法,与setter(设置属性值的方法)对应。其核心作用是通过封装保护数据,避免直接访问内部变量。
示例:
public String getName() {
return this.name; // getter方法返回name属性
}
物理/化学领域
在真空技术中,getter 指一种能吸附残余气体的材料(如钡、铝),常用于电子管或真空设备中维持真空状态。例如显像管内的吸气剂通过化学反应捕获氧气等气体分子。
其他可能用法
常见搭配:
若您有具体语境(如代码示例或技术文档片段),可提供更多细节以便精准解释。
getter
通常是指一个用于获取对象属性值的方法。在编程中,通常会定义 getter
和 setter
方法来控制访问类的私有属性。
She used the getter
method to retrieve the value of the object's private field.(她使用 getter
方法来获取对象的私有字段的值。)
The getter
function returns a copy of the property value.( getter
函数返回属性值的副本。)
getter
方法用于获取对象属性的值,其通常具有如下特征:
getter
方法的名称通常以 get
开头,后面紧跟属性名,例如 getName()
getter
方法不需要传递参数getter
方法通常返回属性的值getter
是面向对象编程中的一个基本概念,用于控制对象属性的访问。通过定义 getter
方法,可以实现对类的私有属性进行读取操作,同时对属性的访问进行控制,例如只读或只写等。
getter
和 setter
方法getter
相反【别人正在浏览】