import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
class ll{
public static void main(String[] a) {
FileReader fr;
try {
fr = new FileReader (new File("C:\\University Study\\Component Engineering\\Assignments\\Assignment !\\yourFile.txt"));
BufferedReader br = new BufferedReader (fr);
String line = br.readLine();
while (line != null) {
System.out.println(line);
line = br.readLine();
}
br.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
The text file and the class are in the same folder and even when i specified the location I still get this exception. It's not a compile error it's a runtime error. I've tried to be as specific as i can but this is my first time posting.