标签:span 封装对象 java ret this style screen 对象 his
this 关键字代表当前对象:
封装对象的属性时,经常会使用this关键字;
eg:
package imooc;
public class Telephone{
private float screen;
private float cpu;
private float mem;
public float getScreen(){
return screen;
}
public void setScreen(float screen){
this.screen=screen;
}
}
标签:span 封装对象 java ret this style screen 对象 his
原文地址:http://www.cnblogs.com/Doris9301/p/7457679.html