public class test
{
private float height;
private float width;
public test(float height,float width)
{
this.height=height;
this.width=width;
}
public float square(){
return height*width;
}
public static void main(String args[]){
test u=new test(3.5f,4.5f);
System.out.println(u.square());
}
}
我没学过this,,看书好深奥.....
这个this是不是把3.5f和435f赋值给了class test中的两个private的.....
还是别的什么意思...?
就是说这个this的原理是啥?简单解释一下就好...让我有一点大体的框架