有必要声明这末大的一个char数组吗?而且你的语法有错误!

解决方案 »

  1.   

    语法嘛就不用考虑了,关键
    是怎么处理.
    在资源快要枯竭的时候就是new char[100],也得判断啊!!!!!!!!!!!
      

  2.   


    try{ }
    catch(Exception){ }
    分配失败会抛出违例
      

  3.   

    我尝试过
    try{
    char c=new char[200000000];
    }catch(Exception){ }
    catch不到这个exception啊!
      

  4.   

    这不是一个Exception而是一个Error,你catch这个Error就行了……
      

  5.   

    java.lang.OutOfMemoryError
    Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector. 
      

  6.   

    thank all.
    给分!给分啊!!!!