public class Test
{
    int i = 0;
    public int getValue()
    {
        return this.i;
    }    public void test()
    {
        int t = this.getValue();
    }public static void main(String[] args)
{
    new Test().test().getValue();
}
}

解决方案 »

  1.   

    getValue执行到了哇。
    public class Test
    {
        int i = 0;
        public int getValue()
        {
         System.out.println("in getValue") ;
            return this.i;
        }    public void test()
        {
            int t = this.getValue();
            System.out.println("test called,i="+i);
        }public static void main(String[] args)
    {
        new Test().test();
       //Test tt= new Test();
       //System.out.println("ok,started");
       //tt.test(); 
    }
    }运行结果。
    in getValue
    test called,i=0没错吧
      

  2.   

    public void test()
    {
        int t = this.getValue();
    }
    t是临时变量,没用
      

  3.   

    三个方法都执行到了啊,你用step into跟进去看看就知道了况且i不是静态的,那它就是实例的成员,不是类的成员。如果你想debug调试跟进去,那你就在想要的地方加个System.out.println("会不会来")吧
      

  4.   

    to kypfos(夜色太漫长):
    为什么要加上
    System.out.println("会不会来")
    不理解??
      

  5.   

    to kypfos(夜色太漫长):
    为什么要加上
    System.out.println("会不会来")
    不理解??
    ----------------
    看看有没有执行到该地方,执行到就在控制台输出相应的字符串
      

  6.   

    这个肯定是执行了,
    print只不过是让你确认一下如果是make的时候,那个debug选项有没有选所有啊? line, field, variable,并且使用step into, 或者直接在int t = this.getValue();加上break point
      

  7.   

    http://psyche.netbig.com/p1/p11/1892/20010521/103267.htmhttp://life2v.szonline.net/content/2003/200301/20030109/89427.html
    够你happy了吧