求教一下代码错误提示地解决方法: 
错误提示: 
    non-static   variable   this   cannot   be   referenced   from   a   static   context   at   line   14   (14:14) 
class   lesson42   { 
  class   point{ 
      int   x,y;   point(int   x,int   y){       this.x=x; 
      this.y=y;       } 
  } 
    public   static   void   main(String[]   args)   { 
      point   p   =   new   point(1,1); 
  point[]   pt1   ;//=new   point[]{   new   point(1,1),new   point(2,2),new   point(3,3)}; 
    } 
}

解决方案 »

  1.   

    如果想从外部类的非静态方法之外的任意位置创建某个内部类的对象,就必须具体地指明这个对象的类型:OutClassName.InnerClassName
    这里应该这样写:lesson42.point p = new lesson42().new point(1, 1); 
      

  2.   

    如果想从外部类的非静态方法之外的任意位置创建某个内部类的对象,就必须具体地指明这个对象的类型:OutClassName.InnerClassName
    这里应该这样写:lesson42.point p = new lesson42().new point(1, 1); 
      

  3.   

    point 是 lesson42的一个属性,你这样写就对了
    class lesson42 {
        class point {
            int x, y;        point(int x, int y) {            this.x = x;
                this.y = y;        }
        }    public static void main(String[] args) {
            lesson42 l = new lesson42();
            point p = l.new point(1, 1);
            point[] pt1;// =new point[]{ new point(1,1),new point(2,2),new
                        // point(3,3)};
        }
    }
      

  4.   

    http://topic.csdn.net/u/20071129/09/8d21157d-216c-4dc4-b810-0e051b4a8228.html