- Hands-On Design Patterns with Java
- Dr. Edward Lavieri
- 54字
- 2021-06-24 14:58:06
Accessor methods
There are only two variables that require accessor methods—sliderValue and poweredOn. Accessor methods for those variables are provided here:
// Accessor Methods
public int getSliderValue() {
return sliderValue;
}
public boolean hasPower () {
return poweredOn;
}
The accessor methods just shown can also be referred to as getter methods.
推薦閱讀
- Building Computer Vision Projects with OpenCV 4 and C++
- 數(shù)據(jù)庫(kù)原理及應(yīng)用教程(第4版)(微課版)
- Unity 5.x Game AI Programming Cookbook
- App+軟件+游戲+網(wǎng)站界面設(shè)計(jì)教程
- 數(shù)據(jù)庫(kù)應(yīng)用基礎(chǔ)教程(Visual FoxPro 9.0)
- 智能數(shù)據(jù)時(shí)代:企業(yè)大數(shù)據(jù)戰(zhàn)略與實(shí)戰(zhàn)
- MATLAB Graphics and Data Visualization Cookbook
- Flutter Projects
- Visual FoxPro數(shù)據(jù)庫(kù)技術(shù)基礎(chǔ)
- 改進(jìn)的群智能算法及其應(yīng)用
- Kubernetes快速進(jìn)階與實(shí)戰(zhàn)
- 碼上行動(dòng):利用Python與ChatGPT高效搞定Excel數(shù)據(jù)分析
- MySQL性能調(diào)優(yōu)與架構(gòu)設(shè)計(jì)
- 從零進(jìn)階!數(shù)據(jù)分析的統(tǒng)計(jì)基礎(chǔ)(第2版)
- Mastering Java for Data Science