你可能还没有明白类,静态类成员,非静态类成员之间的区别建议看看Java的入门资料

解决方案 »

  1.   

    public String methodA() {
      ...
    }We can use
      String x = methodA().substring(2) to do something.
    It is equal to
      String tmp = methodA();
      String x = tmp.substring(2);It's somewhat confusing. I had the same problem when I was studying Java.
      

  2.   

    System.out.println();out是System类的静态变量,是PrintStream的一个实例,println()是类PrintStream的一个方法