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这样的可以吗??
互换的青春