S
Shawn
Hi,
I believe I fully understand how to do input/output and I have never run
into problems. But I don't know why this time I cannot make it work. It
is very simple: a text file called "d_array.txt", located in the SAME
folder. But the error says "The system cannot find the file specified".
try
{
BufferedReader inputStream = new BufferedReader(new
FileReader("d_array.txt"));
String line = null;
line = inputStream.readLine().trim();
while ( line != null )
{
this.D.add(Double.valueOf(line));
line = inputStream.readLine().trim();
}
inputStream.close();
}
catch block
I have played the path to the file like following, neither worked:
new FileReader("./d_array.txt");
new FileReader("D:/programming/d_array.txt");
new FileReader("D:\\programming\\d_array.txt");
I am using Eclipse. This is the only thing different from my previous
experience.
Thank you for your help.
I believe I fully understand how to do input/output and I have never run
into problems. But I don't know why this time I cannot make it work. It
is very simple: a text file called "d_array.txt", located in the SAME
folder. But the error says "The system cannot find the file specified".
try
{
BufferedReader inputStream = new BufferedReader(new
FileReader("d_array.txt"));
String line = null;
line = inputStream.readLine().trim();
while ( line != null )
{
this.D.add(Double.valueOf(line));
line = inputStream.readLine().trim();
}
inputStream.close();
}
catch block
I have played the path to the file like following, neither worked:
new FileReader("./d_array.txt");
new FileReader("D:/programming/d_array.txt");
new FileReader("D:\\programming\\d_array.txt");
I am using Eclipse. This is the only thing different from my previous
experience.
Thank you for your help.