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這樣的可以嗎??
- 2 回答
- 0 關注
- 1062 瀏覽
添加回答
舉報
0/150
提交
取消