Throw and Catch an IO exception because the file zxcvb.data doesn't exist

image_pdfimage_print
   


using System.IO;

public class IoError {
  public static void Main() {
    StreamReader f;
    try{
      f = new StreamReader("DoesNotExist.data");
    }catch(IOException e) {
      System.Console.WriteLine(e);
    }
    f = new StreamReader("DoesNotExist.data");
  }
}