i am having this error when trying to run:
Problem reading Threatalerts.txt
what could be my problem ?
where the file Threatalerts.txt should be stored?
this is my code
import java.io.*;
class ReadTextFile
{
public static void main ( String[] args )
{
String fileName ="Threatalerts.txt" ;
String line;
try
{
BufferedReader in = new BufferedReader(
new FileReader( fileName ) );
line = in.readLine();
while ( line != null ) // continue until end of file
{
System.out.println( line );
line = in.readLine();
}
in.close();
}
catch ( IOException iox )
{
System.out.println("Problem reading " + fileName );
}
}
}