提示很清楚了。Contents是什么来的?java的标准类还是你自己写的?总之你并没有import它的package进来

解决方案 »

  1.   

    很明显,你先使用后定义了Contents class。把Contents class的定义提出来放到public Contents cont() 前面去吧。public class Parce {
      class Contents() {
          private int i = 11;
          public int value(){ return i; }
      }  public Contents cont() {
        return new Contents; 
        }
      }
      

  2.   

    你的语法问题哦。首先WHAT IS Contents  .方法吗。  也没有定义类怎么能。创建对象。
      

  3.   

    应该这样的。
    public class Contents() {
          private int i = 11;
          public int value(){ return i; }
      }public class Parce {
      public Contents cont() {
        return new Contents; 
        }
      }