C#: public class studyingClass { private float width=2; public float Width { get { return this.width; } set { width = value; } } }java:public class Studyingclass{private float width=2;public float getWidth(){return width;}public void setWidth(float value){this.width=value;}}java中的get set方法,一定要叫那样的名字吗??我叫get2009这样的可以吗??
添加回答
举报
0/150
提交
取消