java 中的 this
自动生成 get 和 set 的方法
右键 -> source -> Genenor getter and setter
package com.imooc;
import com.sun.glass.ui.Screen;
public class Telphone {
private float screen;
private float cpu;
public void sendMessage() {
System.out.println(“sendmessage”);
}
public float getScreen() {
return screen;
}
public void setScreen(float screen) {
this.screen = screen;
this.sendMessage();
}
public float getCpu() {
return cpu;
}
public void setCpu(float cpu) {
this.cpu = cpu;
}
public Telphone() {
System.out.println(“ 无参的构造方法 ”);
}
}