java类名,java 中 this 类名 对象名 的作用

  this 表示“当前对象”,不能用在静态的方法中。 对象象你知道的就有很多拉,变量拉,线程等等。 1.This用来表示全局变量 public class TestClass { int x,y; void testShow(int x,int y){ this.x=x; //this.x 就是我们上 int x,y;中的X 。x是我们传来的x this.y=y; } } 2. public ... [阅读全文]
1 共1条 分1页