public class T3 {
private int x=5;
public void display(int x){
System.out.println(x);
System.out.println(this.x);
}
public static void main(String[] args) {
new T3().display(3);
}
}
当局部变量和对象内部成员属性同名的时候,用this来表示成员属性,没有this的表示局部变量
[
本帖最后由 shellingford 于 2013-1-19 12:48 编辑 ]