第一个写错了
public class hello {
  int i= 10;
  classse cla=new classse(i);
// 出错non-static variable this cannot be referenced from a static context
//  cla.show();
  public hello() {
    System.out.println("hello.show()");
  }  public static void main(String[] args) {
    int i= 10;
    classse cla=new classse(i);//
    cla.show();
    hello hello1 = new hello();
  }
  public class classse {
    public classse(int i){
      System.out.println(i);
    }
    public void show(){
      System.out.println("classse.show()");
    }
  }
}

解决方案 »

  1.   

    int i= 10;
      classse cla=new classse(i);
    // 出错non-static variable this cannot be referenced from a static context
    //  cla.show();
      public hello() {
        System.out.println("hello.show()");
      }  public static void main(String[] args) {
        int i= 10;
        classse cla=new hello().new classse(i);//这样实例化
        cla.show();
        hello hello1 = new hello();
      }
      public class classse {
        public classse(int i){
          System.out.println(i);
        }
        public void show(){
          System.out.println("classse.show()");
        }
      }
    }
      

  2.   

    public class classse 改为
    static class classse
      

  3.   

    treeroot(根根)   能说明为什么吗?
      

  4.   

    tom2005(快乐着)  谢谢!
      

  5.   

    http://www.yesky.com/20021024/1636647.shtml看一下这个