Possible Exception Example

Suppose we have this code:

     int [] OurArray = new int[6];

     int I = 0;

     String S;

     using (StreamReader SR = new StreamReader("OurData.txt")
     {
      S = SR.ReadLine();

      while (S != null)
      {
       OurArray[I] = (int) ConverttoInt64(S);
       I++;
       S = SR.ReadLine();
      }
     }

What could happen with this code?

Thus, in theory we could have 5 or 6 catch blocks. If we want to use the catch blocks, we will need to have some try blocks as well.

Could we avoid the problems involved? Yes, probably we could: