- Hands-On Design Patterns with Java
- Dr. Edward Lavieri
- 64字
- 2021-06-24 14:57:58
The this reference
In Java, we can use the this keyword as a reference to the current object. For example, the following code snippet sets the color of the current Bicycle object:
public void setColor(String theColor) {
this.color = theColor;
}
The preceding setColor method accepts a String parameter and assigns it to the color instance variable of the current object.
推薦閱讀
- 數(shù)據(jù)挖掘原理與實(shí)踐
- 有趣的二進(jìn)制:軟件安全與逆向分析
- 輕松學(xué)大數(shù)據(jù)挖掘:算法、場(chǎng)景與數(shù)據(jù)產(chǎn)品
- Creating Mobile Apps with Sencha Touch 2
- 從0到1:數(shù)據(jù)分析師養(yǎng)成寶典
- Python數(shù)據(jù)分析、挖掘與可視化從入門(mén)到精通
- PySpark大數(shù)據(jù)分析與應(yīng)用
- 從實(shí)踐中學(xué)習(xí)sqlmap數(shù)據(jù)庫(kù)注入測(cè)試
- 菜鳥(niǎo)學(xué)SPSS數(shù)據(jù)分析
- Spring MVC Beginner’s Guide
- 改進(jìn)的群智能算法及其應(yīng)用
- 云工作時(shí)代:科技進(jìn)化必將帶來(lái)的新工作方式
- 數(shù)據(jù)之美:一本書(shū)學(xué)會(huì)可視化設(shè)計(jì)
- Arquillian Testing Guide
- 一本書(shū)講透數(shù)據(jù)治理:戰(zhàn)略、方法、工具與實(shí)踐