-2
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class OpenTest {

    public static void main(String args[]){

        int ln = 0;

        try {

            BufferedReader in = new BufferedReader (new 
            FileReader("test.txt"));

                String line = null;

                while ((line = in.readLine()) != null) {

                ln ++;

                System.out.println("Line " + ln + " : " + line);
            }
        }catch (IOExpectation e){
         e.printStackTrace();   

        }
    }
}

Here is the error it's giving me:

--------------------Configuration: <Default>--------------------
C:\Users\Kirsty\Documents\Javadocs\Java Kirsty\Quiz Project\OpenTest.java:23: error: cannot find symbol
        }catch (IOExpectation e){
                ^
  symbol:   class IOExpectation
  location: class OpenTest
1 error

How can I solve it?

melpomene
  • 84,125
  • 8
  • 85
  • 148

1 Answers1

0

Change the word IOExpectation for IOException because as @melpomene says, they are different words.

JTejedor
  • 1,082
  • 10
  • 24