弱弱的问一下关于Java的一个问题
我是一个菜鸟,刚学习JAVA,在编译一个程序的时候遇到了些问题,请问如何解决,请大家不要笑话啊!
public class TestThis{
int i = 0;
TestThis(int _i){
i= _i;
}
int p(){
i++;
return i;
}
void print(){
System.out.println("i="+i);
}
public static void main(String args[]){
TestThis t=new TestThis(100);
t.p().p().print();
}
}
这个程序在编译过程中提示:无法取消引用int,请问这是为什么?应该怎么改这个程序呢?前提是不使用this关键字。