封装
代码get,set
/javaDemo2/src/com/imooc/Telphone.java
package com.imooc;import com.sun.glass.ui.Screen;public class Telphone { private float screen; public float getScreen() { return screen; } public void setScreen(float newScreen) { screen = newScreen; } public Telphone() { System.out.println("无参的构造方法"); }}
/javaDemo2/src/com/imooc/InitailTelphone.java
package com.imooc;import com.sun.glass.ui.Screen;public class Telphone { private float screen; public float getScreen() { return screen; } public void setScreen(float newScreen) { screen = newScreen; } public Telphone() { System.out.println("无参的构造方法"); }}