java.io.IOException : IOException « java.io « Java by API






java.io.IOException

    

import java.io.IOException;

public class Main {

  public static void main(String[] args) {

    try {
      while (true) {
        int datum = System.in.read();
        if (datum == -1)
          break;
        System.out.println(datum);
      }
    } catch (IOException ex) {
      System.err.println("Couldn't read from System.in!");
    }
  }
}

   
    
    
    
  








Related examples in the same category