EOFException - how to handle?

后端 未结 7 1131
迷失自我
迷失自我 2020-11-27 17:11

I\'m a beginner java programmer following the java tutorials.

I am using a simple Java Program from the Java tutorials\'s Data Streams Page, and at runtime, it keeps

7条回答
  •  温柔的废话
    2020-11-27 17:39

    Put your code inside the try catch block: i.e :

    try{
      if(in.available()!=0){
        // ------
      }
    }catch(EOFException eof){
      //
    }catch(Exception e){
      //
    }
    }
    

提交回复
热议问题